Re: Orphaning emile
Finn Thain <fthain@telegraphics.com.au> writes:
> @@ -21,7 +22,9 @@ OSErr SerGetBuf(short refNum, long *count)
>
> res = PBStatusSync((ParmBlkPtr)¶m);
>
> - *count = *(long*)param.csParam;
> + p = (((unsigned)param.csParam[0] & 0xFFFF) << 16) +
> + (((unsigned)param.csParam[1] & 0xFFFF) << 0);
> + *count = *(long *)p;
This now dereferences too much.
> @@ -83,7 +83,8 @@ static inline OSErr GetCurrentMode(short refNum, VDSwitchInfoRec *hwMode)
>
> param.csCode = cscGetCurMode;
> param.ioCRefNum = refNum;
> - *((VDSwitchInfoRec **)¶m.csParam[0]) = hwMode;
> + param.csParam[0] = (*(unsigned long *)hwMode >> 16) & 0xFFFF;
> + param.csParam[1] = (*(unsigned long *)hwMode >> 0) & 0xFFFF;
Likewise.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Reply to: