Switch to more modern int swapping routines

This commit is contained in:
Matthias Neeracher 2011-07-24 03:29:15 +00:00
parent 4eeda831aa
commit 9a73214b9f

View File

@ -312,7 +312,7 @@ char *OSTypeToStr(char *buf, OSType t)
{ {
char *p = buf; char *p = buf;
char str[4], *q = str; char str[4], *q = str;
*(UInt32 *)str = EndianU32_NtoB(t); *(UInt32 *)str = OSSwapHostToBigInt32(t);
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
if (isprint(*q) && *q != '\\') if (isprint(*q) && *q != '\\')
*p++ = *q++; *p++ = *q++;
@ -348,7 +348,7 @@ int StrToOSType(const char *str, OSType &t)
p += 2; p += 2;
} }
} }
t = EndianU32_BtoN(*(UInt32 *)buf); t = OSSwapBigToHostInt32(*(UInt32 *)buf);
return p - str; return p - str;
fail: fail:
return 0; return 0;