<div dir="ltr"><div dir="ltr">Sorry, the correct code is:<div><br></div><div>tvec = (TVector *)gCIPtr;<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">Am Fr., 28. Dez. 2018 um 05:00 Uhr schrieb Max Poliakovski <<a href="mailto:maximumspatium@googlemail.com">maximumspatium@googlemail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">> I wonder how Apple guys managed to put 0xDEADBEEF into TVector's TOC? Do you have any clue?<br>
I'm guessing they did it in assembly. Or maybe there are some special macros in the Universal Interfaces for working with TVectors? Special casting trickery? You might be able to cast a TVector to an int array or a struct or something. Not sure.<br></blockquote><div><br></div><div>Thank you for your suggestions! The following works:<br></div><div><br></div><div>typedef struct TVector {</div><div> void *ptr;</div><div> long toc;</div><div>} TVector;</div><div><br></div><div>void main(int argc, int argv[], OfCiPtr ciPtr)</div><div>{</div><div> TVector *tvec;</div><div><br></div><div> tvec = (TVector *)ciPtr;</div><div> tvec->ptr = ciPtr;</div><div> tvec->toc = 0xdeadbeef;</div><div>}</div><div><br></div><div>Anyway, that looks like an unnatural way to initialize transition vectors...</div></div></div>
</blockquote></div>