Re: ole32: fix for big-endian machines
23 Apr
2005
23 Apr
'05
1:18 p.m.
Juan Lang <juan_lang(a)yahoo.com> writes:
void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) { - memcpy(value, buffer+offset, sizeof(WORD)); + *value = le16toh(*(WORD *)(buffer+offset)); }
Why are you removing the memcpy? Are the offsets guaranteed to always be properly aligned?
+#ifdef WORDS_BIGENDIAN + +/* FIXME: more-optimal versions may be in <byteswap.h>, <sys/bswap.h>, or + * <sys/endian.h>. Use config checks to find 'em.
No, you don't want config checks, what you want to use here is RtlUshortByteSwap/RtlUlongByteSwap. -- Alexandre Julliard julliard(a)winehq.org
7628
Age (days ago)
7628
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard