<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On 5 Sep 2017 16:50, "Phil Thompson" <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">On 30 Aug 2017, at 8:44 pm, Shaheed Haque <<a href="mailto:srhaque@theiet.org">srhaque@theiet.org</a>> wrote:<br>
><br>
> Hi Phil,<br>
><br>
> I have a bit of C++ like this:<br>
><br>
> ========<br>
> typedef struct prob {<br>
> int p_range;<br>
> int p_offset;<br>
> } Prob;<br>
><br>
> static const Prob freqs[16] = {<br>
> {0, 0}, ...<br>
> };<br>
> ========<br>
><br>
> (all this is at global scope). The SIP I create for this is:<br>
><br>
> ========<br>
> struct prob<br>
> {<br>
> %TypeHeaderCode<br>
> #include <MessageViewer/KXFace><br>
> %End<br>
> int p_range;<br>
> int p_offset;<br>
> };<br>
><br>
> const prob *freqs /NoSetter/;<br>
> ========<br>
><br>
> In response, SIP creates this code which does not compile, complaining<br>
> "error: invalid conversion from ‘const void*’ to ‘void*’":<br>
><br>
> ========<br>
> /* Define the class and enum instances to be added to this module dictionary. */<br>
> static sipTypeInstanceDef typeInstances[] = {<br>
> {sipName_freqs, & ::freqs, &sipType_prob, SIP_INDIRECT},<br>
> {0, 0, 0, 0}<br>
> };<br>
> ========<br>
><br>
> Inserting a cast to make the second filed look like "(void *)&<br>
> ::freqs" suppresses the error. Now, I could probably cook up a patch<br>
> to do this, but I'm not sure if the correct fix is actually to change<br>
> the definition of the field to "const void *ti_ptr"?<br>
><br>
> Any thoughts?<br>
<br>
</div>Tonight's snapshot has the cast.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Thanks for the quick turnaround as usual! I'll add the patch to my Python 2 code as Clang has still not released Python 3 support...</div><div dir="auto"><br></div><div dir="auto">Shaheed</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="#888888"><br>
Phil</font></blockquote></div><br></div></div></div>