Package: hfsplus
Severity: normal
Tags: patch

When building 'hfsplus' on ppc64 with gcc-4.0,
I get the following error:

btree.c:86: error: invalid lvalue in increment
btree.c:87: error: invalid lvalue in increment
btree.c:88: error: invalid lvalue in increment
btree.c:89: error: invalid lvalue in increment
btree.c:90: error: invalid lvalue in increment
btree.c:91: error: invalid lvalue in increment
btree.c:92: error: invalid lvalue in increment
btree.c:93: error: invalid lvalue in increment
btree.c:94: error: invalid lvalue in increment
btree.c:97: error: invalid lvalue in increment
btree.c:99: error: invalid lvalue in increment
make[4]: *** [btree.lo] Error 1
make[4]: Leaving directory `/hfsplus-1.0.4/libhfsp/src'

With the attached patch 'hfsplus' can be compiled
on ppc64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/hfsplus-1.0.4/libhfsp/src/swab.h ./libhfsp/src/swab.h
--- ../tmp-orig/hfsplus-1.0.4/libhfsp/src/swab.h        2005-03-18 
19:51:47.198933593 +0100
+++ ./libhfsp/src/swab.h        2005-03-18 19:50:04.403589114 +0100
@@ -48,25 +48,25 @@
 
 #define bswabU16(val) val
 
-#define bswabU16_inc(ptr) (*((UInt16*) (ptr))++)
+#define bswabU16_inc(ptr) ptr = (UInt16*)ptr + 1
 /* Only available as a GCC extension, but required on sparc due to
    alignment issues in some of the on-disk structs */
 #if defined(__GNUC__) && defined(__sparc__)
 #define bswabU32_inc(ptr) ({                   \
        unsigned char *c = (char*)ptr;          \
-       ((UInt32 *)ptr)++;                      \
+       ptr = ((UInt32 *)ptr) + 1;              \
        ((c[0] << 24)+(c[1] << 16)+(c[2] << 8)+c[3]);})
 #define bswabU64_inc(ptr) ({                   \
        unsigned char *c = (char*)ptr;          \
        UInt64 val = 0;                         \
        int i = 0;                              \
-       ((UInt64 *)ptr)++;                      \
+       ptr = ((UInt64 *)ptr) + 1;              \
        while (i < 8)                           \
                val += (c[i] << (8*(7-i++)));   \
        val;})
 #else
-#define bswabU32_inc(ptr) (*((UInt32*) (ptr))++)
-#define bswabU64_inc(ptr) (*((UInt64*) (ptr))++)
+#define bswabU32_inc(ptr) ptr = (UInt32*)ptr + 1
+#define bswabU64_inc(ptr) ptr = (UInt64*)ptr + 1
 #endif
 
 #define bstoreU16_inc(ptr, val) *((UInt16*) (ptr)) = val; ptr = (UInt16*)ptr + 
1


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to