[CDG5] MPW code mysteries

Max Poliakovski maximumspatium at googlemail.com
Fri Dec 28 12:02:05 AWST 2018


Sorry, the correct code is:

tvec = (TVector *)gCIPtr;

Am Fr., 28. Dez. 2018 um 05:00 Uhr schrieb Max Poliakovski <
maximumspatium at googlemail.com>:

>
> > I wonder how Apple guys managed to put 0xDEADBEEF into TVector's TOC? Do
>> you have any clue?
>> 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.
>>
>
> Thank you for your suggestions! The following works:
>
> typedef struct TVector {
>     void    *ptr;
>     long    toc;
> } TVector;
>
> void main(int argc, int argv[], OfCiPtr ciPtr)
> {
>     TVector    *tvec;
>
>     tvec = (TVector *)ciPtr;
>     tvec->ptr = ciPtr;
>     tvec->toc = 0xdeadbeef;
> }
>
> Anyway, that looks like an unnatural way to initialize transition
> vectors...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ucc.gu.uwa.edu.au/pipermail/cdg5/attachments/20181228/15959a09/attachment.htm 


More information about the cdg5 mailing list