Re: [swift-users] C API returns null but optional thinks it's set anyway

2016-07-01 Thread Rick Mann via swift-users
> On Jul 1, 2016, at 05:42 , Dan Loewenherz wrote: > > What’s the Swift type signature on GDALOpen? My guess is that it’s returning > a UnsafePointer or UnsafeMutablePointer type. Swift doesn’t > currently handle nullability for C pointers (hence the “Unsafe” prefix). >

[swift-users] C API returns null but optional thinks it's set anyway

2016-07-01 Thread Rick Mann via swift-users
I have some Swift code (in Xcode 7.3) that's calling a C function in the GDAL library. It's declared like this: typedef void *GDALDatasetH; GDALDatasetH CPL_DLL CPL_STDCALL GDALOpen( const char *pszFilename, GDALAccess eAccess ) CPL_WARN_UNUSED_RESULT; I'm calling it with code like this: class