  * C code.  This is because we modify a copy of the structure 
  * populated by the C code.
  */
-let OneWayCallback : my_cb_t = {( p : UnsafeMutablePointer<Void> )->Void in
+let OneWayCallback : my_cb_t = {( p : UnsafeMutableRawPointer? )->Void in
     print( "In OneWayCallback(), received a void pointer. " );
-    var _apiS : APIStruct = (UnsafeMutablePointer<APIStruct>(p)).memory
+    // Could have used unsafeBitCast() here
+    guard var _apiS = p?.assumingMemoryBound(to: APIStruct.self).pointee else {
+        print("Could not dereference APIStruct pointer.")
+        return
+    }
     printAPI ( _apiS );
-    print( "Setting m_Long in the structure to 98765432109 " )
+    print( "Setting m_Long in the structure to 98765432109" )
     _apiS.m_Long = 98765432109
 }
 

}

/**
 * Prints an instance of NaiveStruct.  Only selected fields are printed.
 */
func printNaive( s : NaiveStruct )
{
    print( "Printing NaiveStruct: " )
    print( "  m_Long: \(s.m_Long)" )
    print( "  m_Array: \(s.m_Array.0) \(s.m_Array.1) \(s.m_Array.2) " )
}

/**
 * This is a naive implementation of the callback.  Casts the void *,
 * provided via an argument of type UnsafeMutablePointer<Void>, to
 * UnsafeMutablePointer<NativeStruct>, takes its memory and naively
 * creates an instance of NaiveStruct from it.
 *
 * This may or may not work depending on how APIStruct is packed in C

/**
 * A better callback implementation.
 *
 * This one converts the void pointer to UnsafeMutablePointer<APIStruct>,
 * then uses its memory to construct an instance of APIStruct.  Even if
 * tight packing is used by the C code, the APIStruct will correctly 
 * reflect the data placed there by the C code.  This is as long as 
