use the newly supported "= { 0x1234 }" syntax instead of non-standard __attribute__((__raw_inline__(0x1234))).

This commit is contained in:
Wolfgang Thaller 2015-08-27 22:13:32 +02:00
parent ee736a689c
commit 65dbaedf5d
2 changed files with 28 additions and 51 deletions

View File

@ -35,12 +35,11 @@
#include <Quickdraw.h> #include <Quickdraw.h>
QDGlobals qd; QDGlobals qd;
#pragma parameter __D0 _GetPtrSize(__A0)
pascal long _GetPtrSize(Ptr ptr) = { 0xA021 };
pascal Size GetPtrSize(Ptr ptr) pascal Size GetPtrSize(Ptr ptr)
{ {
#pragma parameter __D0 _GetPtrSize(__A0)
pascal long _GetPtrSize(Ptr ptr) ONEWORDINLINE(0xA021);
long tmp = _GetPtrSize(ptr); long tmp = _GetPtrSize(ptr);
if(tmp > 0) if(tmp > 0)
return (Size) tmp; return (Size) tmp;
@ -48,11 +47,11 @@ pascal Size GetPtrSize(Ptr ptr)
return 0; return 0;
} }
#pragma parameter __D0 _GetHandleSize(__A0)
pascal long _GetHandleSize(Handle h) = { 0xA025 };
pascal Size GetHandleSize(Handle h) pascal Size GetHandleSize(Handle h)
{ {
#pragma parameter __D0 _GetHandleSize(__A0)
pascal long _GetHandleSize(Handle h) ONEWORDINLINE(0xA025);
long tmp = _GetHandleSize(h); long tmp = _GetHandleSize(h);
if(tmp > 0) if(tmp > 0)
return (Size) tmp; return (Size) tmp;
@ -60,51 +59,62 @@ pascal Size GetHandleSize(Handle h)
return 0; return 0;
} }
#pragma parameter __A0 _PtrToHand(__A0, __D0)
pascal Handle _PtrToHand(const void *srcPtr, long size) = { 0xA9E3 };
EXTERN_API( OSErr ) EXTERN_API( OSErr )
PtrToHand( PtrToHand(
const void * srcPtr, const void * srcPtr,
Handle * dstHndl, Handle * dstHndl,
long size) long size)
{ {
#pragma parameter __A0 _PtrToHand(__A0, __D0)
pascal Handle _PtrToHand(const void *srcPtr, long size) ONEWORDINLINE(0xA9E3);
*dstHndl = _PtrToHand(srcPtr, size); *dstHndl = _PtrToHand(srcPtr, size);
return MemError(); return MemError();
} }
#pragma parameter __A0 _HandToHand(__A0)
pascal Handle _HandToHand(Handle h) = { 0xA9E1 };
EXTERN_API( OSErr ) EXTERN_API( OSErr )
HandToHand(Handle * theHndl) HandToHand(Handle * theHndl)
{ {
#pragma parameter __A0 _HandToHand(__A0)
pascal Handle _HandToHand(Handle h) ONEWORDINLINE(0xA9E1);
*theHndl = _HandToHand(*theHndl); *theHndl = _HandToHand(*theHndl);
return MemError(); return MemError();
} }
#pragma parameter __D0 _StringToNum(__A0)
pascal long _StringToNum(ConstStr255Param theString) = { 0x3F3C, 0x0001, 0xA9EE };
EXTERN_API( void ) EXTERN_API( void )
StringToNum( StringToNum(
ConstStr255Param theString, ConstStr255Param theString,
long * theNum) long * theNum)
{ {
#pragma parameter __D0 _StringToNum(__A0)
pascal long _StringToNum(ConstStr255Param theString) THREEWORDINLINE(0x3F3C, 0x0001, 0xA9EE);
*theNum = _StringToNum(theString); *theNum = _StringToNum(theString);
} }
#pragma parameter _NumToString(__D0, __A0)
pascal long _NumToString(long theNum, ConstStr255Param theString) = { 0x4267, 0xA9EE };
EXTERN_API( void ) EXTERN_API( void )
NumToString( NumToString(
long theNum, long theNum,
Str255 theString) Str255 theString)
{ {
#pragma parameter _NumToString(__D0, __A0)
pascal long _NumToString(long theNum, ConstStr255Param theString) TWOWORDINLINE(0x4267, 0xA9EE);
_NumToString(theNum, theString); _NumToString(theNum, theString);
} }
#pragma parameter __D0 _CmpString(__A0, __A1, __D0)
pascal long _CmpString(const char *a, const char *b, long lens) = { 0xA03C };
#pragma parameter __D0 _CmpStringCase(__A0, __A1, __D0)
pascal long _CmpStringCase(const char *a, const char *b, long lens) = { 0xA43C };
#pragma parameter __D0 _CmpStringMarks(__A0, __A1, __D0)
pascal long _CmpStringMarks(const char *a, const char *b, long lens) = { 0xA23C };
#pragma parameter __D0 _CmpStringCaseMarks(__A0, __A1, __D0)
pascal long _CmpStringCaseMarks(const char *a, const char *b, long lens) = { 0xA63C };
EXTERN_API( Boolean ) EXTERN_API( Boolean )
EqualString( EqualString(
ConstStr255Param str1, ConstStr255Param str1,
@ -112,15 +122,6 @@ EqualString(
Boolean caseSensitive, Boolean caseSensitive,
Boolean diacSensitive) Boolean diacSensitive)
{ {
#pragma parameter __D0 _CmpString(__A0, __A1, __D0)
pascal long _CmpString(const char *a, const char *b, long lens) ONEWORDINLINE(0xA03C);
#pragma parameter __D0 _CmpStringCase(__A0, __A1, __D0)
pascal long _CmpStringCase(const char *a, const char *b, long lens) ONEWORDINLINE(0xA43C);
#pragma parameter __D0 _CmpStringMarks(__A0, __A1, __D0)
pascal long _CmpStringMarks(const char *a, const char *b, long lens) ONEWORDINLINE(0xA23C);
#pragma parameter __D0 _CmpStringCaseMarks(__A0, __A1, __D0)
pascal long _CmpStringCaseMarks(const char *a, const char *b, long lens) ONEWORDINLINE(0xA63C);
long lens = (str1[0] << 16) | str2[0]; long lens = (str1[0] << 16) | str2[0];
long result; long result;
if(caseSensitive) if(caseSensitive)

View File

@ -6,7 +6,8 @@ export LANG=en
# cp $IN/[A-Z]*.h $OUT/ # cp $IN/[A-Z]*.h $OUT/
for file in $(cd $IN; ls [A-Z]*.h); do for file in $(cd $IN; ls [A-Z]*.h); do
tr '\r' '\n' < $IN/$file | sed 's/= \(0x[0-9A-Z]*\);/ONEWORDINLINE(\1);/' > $OUT/$file tr '\r' '\n' < $IN/$file > $OUT/$file
#| sed 's/= \(0x[0-9A-Z]*\);/ONEWORDINLINE(\1);/' > $OUT/$file
done done
cat > $OUT/ConditionalMacros.h <<END_MARKER cat > $OUT/ConditionalMacros.h <<END_MARKER
@ -30,31 +31,6 @@ tr '\r' '\n' < $IN/ConditionalMacros.h | sed 's/__GNUC__/__GNUC_DISABLED__/g' >>
cat >> $OUT/ConditionalMacros.h <<END_MARKER cat >> $OUT/ConditionalMacros.h <<END_MARKER
#undef ONEWORDINLINE(w1)
#undef TWOWORDINLINE(w1,w2)
#undef THREEWORDINLINE(w1,w2,w3)
#undef FOURWORDINLINE(w1,w2,w3,w4)
#undef FIVEWORDINLINE(w1,w2,w3,w4,w5)
#undef SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
#undef SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
#undef EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
#undef NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
#undef TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
#undef ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
#undef TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
#define ONEWORDINLINE(w1) __attribute__((__raw_inline__(w1)))
#define TWOWORDINLINE(w1,w2) __attribute__((__raw_inline__(w1,w2)))
#define THREEWORDINLINE(w1,w2,w3) __attribute__((__raw_inline__(w1,w2,w3)))
#define FOURWORDINLINE(w1,w2,w3,w4) __attribute__((__raw_inline__(w1,w2,w3,w4)))
#define FIVEWORDINLINE(w1,w2,w3,w4,w5) __attribute__((__raw_inline__(w1,w2,w3,w4,w5)))
#define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) __attribute__((__raw_inline__(w1,w2,w3,w4,w5,w6)))
#define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) __attribute__((__raw_inline__(w1,w2,w3,w4,w5,w6,w7)))
#define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) __attribute__((__raw_inline__(w1,w2,w3,w4,w5,w6,w7,w8)))
#define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) __attribute__((__raw_inline__(w1,w2,w3,w4,w5,w6,w7,w8,w9)))
#define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) __attribute__((__raw_inline__(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)))
#define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) __attribute__((__raw_inline__(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)))
#define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12) __attribute__((__raw_inline__(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)))
#endif /* __CONDITIONALMACROS__WRAP__ */ #endif /* __CONDITIONALMACROS__WRAP__ */
END_MARKER END_MARKER