Contents of /trunk/pearpc/patches/pearpc-0.3.1-gcc4.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 5336 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 5336 byte(s)
-import
1 | fixes compilation with gcc4 |
2 | |
3 | merged from cvs, more details at: |
4 | http://sourceforge.net/tracker/index.php?func=detail&aid=1235212&group_id=108675&atid=651197 |
5 | |
6 | =================================================================== |
7 | RCS file: /cvsroot/pearpc/pearpc/src/io/prom/fs/hfsplus/swab.h,v |
8 | retrieving revision 1.2 |
9 | retrieving revision 1.3 |
10 | diff -u -r1.2 -r1.3 |
11 | --- pearpc/pearpc/src/io/prom/fs/hfsplus/swab.h 2004/11/04 23:10:30 1.2 |
12 | +++ pearpc/pearpc/src/io/prom/fs/hfsplus/swab.h 2005/07/22 00:59:44 1.3 |
13 | @@ -38,13 +38,13 @@ |
14 | |
15 | #define bswabU16(val) bswap_16(val) |
16 | |
17 | -#define bswabU16_inc(ptr) bswap_16(*((UInt16*) (ptr))++) |
18 | -#define bswabU32_inc(ptr) bswap_32(*((UInt32*) (ptr))++) |
19 | -#define bswabU64_inc(ptr) bswap_64(*((APPLEUInt64*) (ptr))++) |
20 | - |
21 | -#define bstoreU16_inc(ptr, val) (*((UInt16*) (ptr))++) = bswap_16(val) |
22 | -#define bstoreU32_inc(ptr, val) (*((UInt32*) (ptr))++) = bswap_32(val) |
23 | -#define bstoreU64_inc(ptr, val) (*((APPLEUInt64*) (ptr))++) = bswap_64(val) |
24 | +#define bswabU16_inc(ptr) bswap_16(*(*((UInt16**) (void *)(ptr)))++) |
25 | +#define bswabU32_inc(ptr) bswap_32(*(*((UInt32**) (void *)(ptr)))++) |
26 | +#define bswabU64_inc(ptr) bswap_64(*(*((APPLEUInt64**) (void *)(ptr)))++) |
27 | + |
28 | +#define bstoreU16_inc(ptr, val) (*(*((UInt16**) (void *)(ptr)))++) = bswap_16(val) |
29 | +#define bstoreU32_inc(ptr, val) (*(*((UInt32**) (void *)(ptr)))++) = bswap_32(val) |
30 | +#define bstoreU64_inc(ptr, val) (*(*((APPLEUInt64**) (void *)(ptr)))++) = bswap_64(val) |
31 | |
32 | /*#else // BYTE_ORDER == BIG_ENDIAN |
33 | |
34 | @@ -61,5 +61,5 @@ |
35 | #endif*/ |
36 | |
37 | /* for the sake of completeness and readability */ |
38 | -#define bswabU8_inc(ptr) (*((UInt8*) (ptr))++) |
39 | -#define bstoreU8_inc(ptr,val) (*((UInt8*) (ptr))++) = val |
40 | +#define bswabU8_inc(ptr) (*(*((UInt8**) (void *)(ptr)))++) |
41 | +#define bstoreU8_inc(ptr,val) (*(*((UInt8**) (void *)(ptr)))++) = val |
42 | =================================================================== |
43 | RCS file: /cvsroot/pearpc/pearpc/src/io/prom/fs/hfsplus/btree.c,v |
44 | retrieving revision 1.3 |
45 | retrieving revision 1.4 |
46 | diff -u -r1.3 -r1.4 |
47 | --- pearpc/pearpc/src/io/prom/fs/hfsplus/btree.c 2005/04/13 23:51:15 1.3 |
48 | +++ pearpc/pearpc/src/io/prom/fs/hfsplus/btree.c 2005/07/22 00:59:44 1.4 |
49 | @@ -364,7 +364,7 @@ |
50 | /** intialize the btree with the first entry in the fork */ |
51 | static int btree_init(btree* bt, volume* vol, hfsp_fork_raw* fork) |
52 | { |
53 | - void *p; |
54 | + char *p; |
55 | char buf[vol->blksize]; |
56 | UInt16 node_size; |
57 | btree_node_desc* node = &bt->head_node; |
58 | @@ -396,7 +396,7 @@ |
59 | { |
60 | p = volume_readfromfork(vol, nodebuf, fork, 0, bt->blkpernode, |
61 | HFSP_EXTENT_DATA, bt->cnid); |
62 | - ((char*) p) += HEADER_RESERVEDOFFSET; // skip header |
63 | + p += HEADER_RESERVEDOFFSET; // skip header |
64 | } |
65 | |
66 | bt->alloc_bits = malloc(alloc_size); |
67 | =================================================================== |
68 | RCS file: /cvsroot/pearpc/pearpc/src/io/prom/fs/hfsplus/volume.c,v |
69 | retrieving revision 1.6 |
70 | retrieving revision 1.7 |
71 | diff -u -r1.6 -r1.7 |
72 | --- pearpc/pearpc/src/io/prom/fs/hfsplus/volume.c 2005/04/13 23:51:15 1.6 |
73 | +++ pearpc/pearpc/src/io/prom/fs/hfsplus/volume.c 2005/07/22 00:59:44 1.7 |
74 | @@ -344,7 +344,7 @@ |
75 | |
76 | /* Read the volume from the given buffer and swap the bytes. |
77 | */ |
78 | -static int volume_readbuf(hfsp_vh* vh, void* p) |
79 | +static int volume_readbuf(hfsp_vh* vh, char* p) |
80 | { |
81 | if ( (vh->signature = bswabU16_inc(p)) != HFSP_VOLHEAD_SIG) |
82 | HFSP_ERROR(-1, "This is not a HFS+ volume"); |
83 | @@ -368,7 +368,7 @@ |
84 | vh->write_count = bswabU32_inc(p); |
85 | vh->encodings_bmp = bswabU64_inc(p); |
86 | memcpy(vh->finder_info, p, 32); |
87 | - ((char*) p) += 32; // finderinfo is not used by now |
88 | + p += 32; // finderinfo is not used by now |
89 | p = volume_readfork(p, &vh->alloc_file ); |
90 | p = volume_readfork(p, &vh->ext_file ); |
91 | p = volume_readfork(p, &vh->cat_file ); |
92 | @@ -381,7 +381,7 @@ |
93 | |
94 | /* Write the volume to the given buffer and swap the bytes. |
95 | */ |
96 | -static int volume_writebuf(hfsp_vh* vh, void* p) |
97 | +static int volume_writebuf(hfsp_vh* vh, char* p) |
98 | { |
99 | bstoreU16_inc(p, vh->signature ); |
100 | bstoreU16_inc(p, vh->version ); |
101 | @@ -404,7 +404,7 @@ |
102 | bstoreU32_inc(p, vh->write_count ); |
103 | bstoreU64_inc(p, vh->encodings_bmp ); |
104 | memcpy(p, vh->finder_info, 32); |
105 | - ((char*) p) += 32; // finderinfo is not used by now |
106 | + p += 32; // finderinfo is not used by now |
107 | p = volume_writefork(p, &vh->alloc_file ); |
108 | p = volume_writefork(p, &vh->ext_file ); |
109 | p = volume_writefork(p, &vh->cat_file ); |
110 | @@ -427,7 +427,7 @@ |
111 | { |
112 | UInt16 signature; |
113 | char buf[vol->blksize]; |
114 | - void *p = buf; |
115 | + char *p = buf; |
116 | if( volume_readinbuf(vol, buf, 2) ) // Wrapper or volume header starts here |
117 | return -1; |
118 | |
119 | @@ -440,12 +440,12 @@ |
120 | |
121 | UInt16 embeds, embedl; /* Start/lenght of embedded area in blocks */ |
122 | |
123 | - ((char*) p) += 0x12; /* skip unneeded HFS vol fields */ |
124 | + p += 0x12; /* skip unneeded HFS vol fields */ |
125 | drAlBlkSiz = bswabU32_inc(p); /* offset 0x14 */ |
126 | - ((char*) p) += 0x4; /* skip unneeded HFS vol fields */ |
127 | + p += 0x4; /* skip unneeded HFS vol fields */ |
128 | drAlBlSt = bswabU16_inc(p); /* offset 0x1C */ |
129 | |
130 | - ((char*) p) += 0x5E; /* skip unneeded HFS vol fields */ |
131 | + p += 0x5E; /* skip unneeded HFS vol fields */ |
132 | signature = bswabU16_inc(p); /* offset 0x7C, drEmbedSigWord */ |
133 | if (signature != HFSP_VOLHEAD_SIG) |
134 | HFSP_ERROR(-1, "This looks like a normal HFS volume"); |