On Thu, Jan 27, 2011 at 1:37 AM, Federico G. Schwindt <fg...@lodoss.net> wrote: > On Wed, Jan 26, 2011 at 05:13:44PM -0800, patrick keshishian wrote: >> On Wed, Jan 26, 2011 at 4:45 PM, Federico G. Schwindt <fg...@lodoss.net> >> wrote: >> > On Wed, Jan 26, 2011 at 03:15:11PM -0800, patrick keshishian wrote: >> >> http://marc.info/?l=openbsd-ports&m=129372769129646&w=2 >> >> >> >> I never got any replies of "yes", "maybe", "you are out of your >> >> freaking mind", etc. >> > >> > ?what about something like this: >> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=300289? >> > ?looks simpler imho. >> >> The libhfsp/src/swab.h source on debian link seems different than what >> I see in hfsplus_1.0.4.src.tar.bz2 (just downloaded). >> >> MD5 (hfsplus_1.0.4.src.tar.bz2) = 18fa1efb5432469357ffa6bfa7c08fcd >> size: 185461 >> >> >> Either way, I don't think the dabian patch is correct; at least not >> entirely. They propose: >> >> -#define bswabU16_inc(ptr) (*((UInt16*) (ptr))++) >> +#define bswabU16_inc(ptr) ptr = (UInt16*)ptr + 1 >> >> which will change the following (from btree.c): >> >> node->num_rec = bswabU16_inc(p); >> node->reserved = bswabU16_inc(p); >> >> to: >> node->num_rec = p = (UInt16*)p + 1; >> node->reserved = p = (UInt16*)p +1; >> >> I seriously doubt this is the intent of the original code. > > ok, assuming they wanted "*p; *p++" i believe you can do:
No. The intent is: some_integer_type = *(some_integer_type*)p; p = (some_interger_type*)p + sizeof(some_integer_type); --patrick > > #define bswabU16_inc(ptr) ((*((UInt16*)(ptr)))++) > > and will give you the right result. > > f.- >