fixes compilation with gcc4 merged from cvs, more details at: http://sourceforge.net/tracker/index.php?func=detail&aid=1235212&group_id=108675&atid=651197 =================================================================== RCS file: /cvsroot/pearpc/pearpc/src/io/prom/fs/hfsplus/swab.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pearpc/pearpc/src/io/prom/fs/hfsplus/swab.h 2004/11/04 23:10:30 1.2 +++ pearpc/pearpc/src/io/prom/fs/hfsplus/swab.h 2005/07/22 00:59:44 1.3 @@ -38,13 +38,13 @@ #define bswabU16(val) bswap_16(val) -#define bswabU16_inc(ptr) bswap_16(*((UInt16*) (ptr))++) -#define bswabU32_inc(ptr) bswap_32(*((UInt32*) (ptr))++) -#define bswabU64_inc(ptr) bswap_64(*((APPLEUInt64*) (ptr))++) - -#define bstoreU16_inc(ptr, val) (*((UInt16*) (ptr))++) = bswap_16(val) -#define bstoreU32_inc(ptr, val) (*((UInt32*) (ptr))++) = bswap_32(val) -#define bstoreU64_inc(ptr, val) (*((APPLEUInt64*) (ptr))++) = bswap_64(val) +#define bswabU16_inc(ptr) bswap_16(*(*((UInt16**) (void *)(ptr)))++) +#define bswabU32_inc(ptr) bswap_32(*(*((UInt32**) (void *)(ptr)))++) +#define bswabU64_inc(ptr) bswap_64(*(*((APPLEUInt64**) (void *)(ptr)))++) + +#define bstoreU16_inc(ptr, val) (*(*((UInt16**) (void *)(ptr)))++) = bswap_16(val) +#define bstoreU32_inc(ptr, val) (*(*((UInt32**) (void *)(ptr)))++) = bswap_32(val) +#define bstoreU64_inc(ptr, val) (*(*((APPLEUInt64**) (void *)(ptr)))++) = bswap_64(val) /*#else // BYTE_ORDER == BIG_ENDIAN @@ -61,5 +61,5 @@ #endif*/ /* for the sake of completeness and readability */ -#define bswabU8_inc(ptr) (*((UInt8*) (ptr))++) -#define bstoreU8_inc(ptr,val) (*((UInt8*) (ptr))++) = val +#define bswabU8_inc(ptr) (*(*((UInt8**) (void *)(ptr)))++) +#define bstoreU8_inc(ptr,val) (*(*((UInt8**) (void *)(ptr)))++) = val =================================================================== RCS file: /cvsroot/pearpc/pearpc/src/io/prom/fs/hfsplus/btree.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- pearpc/pearpc/src/io/prom/fs/hfsplus/btree.c 2005/04/13 23:51:15 1.3 +++ pearpc/pearpc/src/io/prom/fs/hfsplus/btree.c 2005/07/22 00:59:44 1.4 @@ -364,7 +364,7 @@ /** intialize the btree with the first entry in the fork */ static int btree_init(btree* bt, volume* vol, hfsp_fork_raw* fork) { - void *p; + char *p; char buf[vol->blksize]; UInt16 node_size; btree_node_desc* node = &bt->head_node; @@ -396,7 +396,7 @@ { p = volume_readfromfork(vol, nodebuf, fork, 0, bt->blkpernode, HFSP_EXTENT_DATA, bt->cnid); - ((char*) p) += HEADER_RESERVEDOFFSET; // skip header + p += HEADER_RESERVEDOFFSET; // skip header } bt->alloc_bits = malloc(alloc_size); =================================================================== RCS file: /cvsroot/pearpc/pearpc/src/io/prom/fs/hfsplus/volume.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- pearpc/pearpc/src/io/prom/fs/hfsplus/volume.c 2005/04/13 23:51:15 1.6 +++ pearpc/pearpc/src/io/prom/fs/hfsplus/volume.c 2005/07/22 00:59:44 1.7 @@ -344,7 +344,7 @@ /* Read the volume from the given buffer and swap the bytes. */ -static int volume_readbuf(hfsp_vh* vh, void* p) +static int volume_readbuf(hfsp_vh* vh, char* p) { if ( (vh->signature = bswabU16_inc(p)) != HFSP_VOLHEAD_SIG) HFSP_ERROR(-1, "This is not a HFS+ volume"); @@ -368,7 +368,7 @@ vh->write_count = bswabU32_inc(p); vh->encodings_bmp = bswabU64_inc(p); memcpy(vh->finder_info, p, 32); - ((char*) p) += 32; // finderinfo is not used by now + p += 32; // finderinfo is not used by now p = volume_readfork(p, &vh->alloc_file ); p = volume_readfork(p, &vh->ext_file ); p = volume_readfork(p, &vh->cat_file ); @@ -381,7 +381,7 @@ /* Write the volume to the given buffer and swap the bytes. */ -static int volume_writebuf(hfsp_vh* vh, void* p) +static int volume_writebuf(hfsp_vh* vh, char* p) { bstoreU16_inc(p, vh->signature ); bstoreU16_inc(p, vh->version ); @@ -404,7 +404,7 @@ bstoreU32_inc(p, vh->write_count ); bstoreU64_inc(p, vh->encodings_bmp ); memcpy(p, vh->finder_info, 32); - ((char*) p) += 32; // finderinfo is not used by now + p += 32; // finderinfo is not used by now p = volume_writefork(p, &vh->alloc_file ); p = volume_writefork(p, &vh->ext_file ); p = volume_writefork(p, &vh->cat_file ); @@ -427,7 +427,7 @@ { UInt16 signature; char buf[vol->blksize]; - void *p = buf; + char *p = buf; if( volume_readinbuf(vol, buf, 2) ) // Wrapper or volume header starts here return -1; @@ -440,12 +440,12 @@ UInt16 embeds, embedl; /* Start/lenght of embedded area in blocks */ - ((char*) p) += 0x12; /* skip unneeded HFS vol fields */ + p += 0x12; /* skip unneeded HFS vol fields */ drAlBlkSiz = bswabU32_inc(p); /* offset 0x14 */ - ((char*) p) += 0x4; /* skip unneeded HFS vol fields */ + p += 0x4; /* skip unneeded HFS vol fields */ drAlBlSt = bswabU16_inc(p); /* offset 0x1C */ - ((char*) p) += 0x5E; /* skip unneeded HFS vol fields */ + p += 0x5E; /* skip unneeded HFS vol fields */ signature = bswabU16_inc(p); /* offset 0x7C, drEmbedSigWord */ if (signature != HFSP_VOLHEAD_SIG) HFSP_ERROR(-1, "This looks like a normal HFS volume");