ObjFW  Check-in [d60757d3a0]

Overview
Comment:Use OF_BSWAP32_NONCONST instead of OF_BSWAP32 in OF_BSWAP64_NONCONST.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d60757d3a05fb552ce22241a9167873c7cc0d2cd6c7146e029b1df65f744df66
User & Date: js on 2009-12-01 13:17:17
Other Links: manifest | tags
Context
2009-12-01
13:27
Add missing LD = ${OBJC} to two Makefiles. check-in: 4b763dd49a user: js tags: trunk
13:17
Use OF_BSWAP32_NONCONST instead of OF_BSWAP32 in OF_BSWAP64_NONCONST. check-in: d60757d3a0 user: js tags: trunk
12:55
Make sure we never even check for CC by using OBJCPP as CPP. check-in: 9a733d824f user: js tags: trunk
Changes

Modified src/OFMacros.h from [084aac77e1] to [08c33bc369].

108
109
110
111
112
113
114
115


116
117
118
119
120
121
122
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123







-
+
+







#if defined(OF_AMD64_ASM)
	asm("bswap	%0" : "=r"(i) : "0"(i));
#elif defined(OF_X86_ASM)
	asm("bswap	%%eax\n\t"
	    "bswap	%%edx\n\t"
	    "xchgl	%%eax, %%edx" : "=A"(i): "0"(i));
#else
	i = (uint64_t)OF_BSWAP32(i & 0xFFFFFFFF) << 32 | OF_BSWAP32(i >> 32);
	i = (uint64_t)OF_BSWAP32_NONCONST(i & 0xFFFFFFFF) << 32 |
	    OF_BSWAP32_NONCONST(i >> 32);
#endif
	return i;
}

#ifdef __GNUC__
#define OF_BSWAP16(i) \
	(__builtin_constant_p(i) ? OF_BSWAP16_CONST(i) : OF_BSWAP16_NONCONST(i))