<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body
bgcolor="#FFFFFF" text="#000000">
Still working on the expat wrapper. The thing I need to do is to pass a
pointer to self to be stored in the userData that will be passed to
callbacks, allowing me to get at the local instance. I did this in Swift
2.2 as:<br>
<br>
<span style="font-family: monospace;">XML_SetUserData(parser,
unsafeBitCast(self, UnsafeMutablePointer<Void>.self))</span><br>
<br>
The migrator turned this into:<br>
<br>
<span style="font-family: monospace;">XML_SetUserData(parser,
unsafeBitCast(self, to: UnsafeMutableRawPointer.self))</span><br>
<br>
but it doesn't work. I don't get an appropriate pointer back in the
callback that I can turn into what I need.<br>
<br>
>From reading the migration documentation, I don't want to use
unsafeBitCast if at all possible, but I'm not clear what the alternative
is.<br>
<br>
Also, getting the userData back is something I will need. I currently
use:<br>
<br>
<span style="font-family: monospace;">let theParser =
userData!.bindMemory(to: ExpatSwift.self, capacity: 1)</span><br>
<br>
I think that's correct, but I'm not getting a valid object reference.<br>
<br>
Any insight is greatly appreciated!<br>
<div class="moz-signature">-- <br>John Brownie<br>
In Finland on furlough from SIL Papua New Guinea<br>
</div>
</body>
</html>