Re: [PATCH] FCI work for cabinet.dll [cabinet-fci-patch-03.diff]
27 Jun
2005
27 Jun
'05
2:14 p.m.
"Gerold J. Wucherpfennig" <gjwucherpfennig(a)gmx.net> writes:
+static cab_ULONG fci_set_little_endian_ulong( cab_ULONG i ) { + unsigned char v[4]; + v[0]=i; + v[1]=i>>8; + v[2]=i>>16; + v[3]=i>>24; + return *((cab_ULONG*)(v)); +} + +static cab_ULONG fci_get_little_endian_ulong( cab_ULONG i ) { + unsigned char v[4]; + cab_ULONG r=0; + memcpy(v,&i,4); + r|=v[3]; + r<<=8; + r|=v[2]; + r<<=8; + r|=v[1]; + r<<=8; + r|=v[0]; + return r; +}
You should use the Rtl*ByteSwap functions with the appropriate #ifdef WORDS_BIGENDIAN, it would be a lot more efficient, particularly on little endian platforms that represent 99.9% of the real world cases. -- Alexandre Julliard julliard(a)winehq.org
7470
Age (days ago)
7470
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard