changeset 90:631d02d30a1c

More fixes for 32/64 bit portability on big endian ppc.
author Carl Byington <carl@five-ten-sg.com>
date Tue, 05 Aug 2008 11:52:29 -0700
parents 156213d65958
children 9bd455802437
files ChangeLog NEWS configure.in libpst.spec.in src/debug.c src/libpst.h
diffstat 6 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 05 10:11:41 2008 -0700
+++ b/ChangeLog	Tue Aug 05 11:52:29 2008 -0700
@@ -1,3 +1,7 @@
+LibPST 0.6.17 (2008-08-05)
+===============================
+    	* More fixes for 32/64 bit portability on big endian ppc.
+
 LibPST 0.6.16 (2008-08-05)
 ===============================
     	* Use inttypes.h for portable printing of 64 bit items.
--- a/NEWS	Tue Aug 05 10:11:41 2008 -0700
+++ b/NEWS	Tue Aug 05 11:52:29 2008 -0700
@@ -1,3 +1,4 @@
+0.6.17  2008-08-05 More fixes for 32/64 bit portability on big endian ppc.
 0.6.16  2008-08-05 Use inttypes.h for portable printing of 64 bit items.
 0.6.15  2008-07-30 Fix file handle leak in error case, missing length on lz decompression.
 0.6.14  2008-06-15 Fix my mistake in debian packaging.
--- a/configure.in	Tue Aug 05 10:11:41 2008 -0700
+++ b/configure.in	Tue Aug 05 11:52:29 2008 -0700
@@ -1,5 +1,5 @@
 AC_PREREQ(2.59)
-AC_INIT(libpst,0.6.16,carl@five-ten-sg.com)
+AC_INIT(libpst,0.6.17,carl@five-ten-sg.com)
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
 
--- a/libpst.spec.in	Tue Aug 05 10:11:41 2008 -0700
+++ b/libpst.spec.in	Tue Aug 05 11:52:29 2008 -0700
@@ -47,6 +47,9 @@
 
 
 %changelog
+* Tue Aug 05 2008 Carl Byington <carl@five-ten-sg.com> - 0.6.17-1
+- More fixes for 32/64 bit portability on big endian ppc.
+
 * Tue Aug 05 2008 Carl Byington <carl@five-ten-sg.com> - 0.6.16-1
 - Use inttypes.h for portable printing of 64 bit items.
 
--- a/src/debug.c	Tue Aug 05 10:11:41 2008 -0700
+++ b/src/debug.c	Tue Aug 05 11:52:29 2008 -0700
@@ -55,7 +55,7 @@
     if (col == -1) col = NUM_COL;
     fprintf(out, "\n");
     while (off < size) {
-        fprintf(out, "%06X\t:", off+delta);
+        fprintf(out, "%06"PRIx64"\t:", (uint64_t)(off+delta));
         toff = off;
         while (count < col && off < size) {
             fprintf(out, "%02hhx ", (unsigned char)buf[off]);
--- a/src/libpst.h	Tue Aug 05 10:11:41 2008 -0700
+++ b/src/libpst.h	Tue Aug 05 11:52:29 2008 -0700
@@ -33,14 +33,14 @@
 
 #if BYTE_ORDER == BIG_ENDIAN
 #  define LE64_CPU(x) \
-  x = ((((x) & 0xff00000000000000) >> 56) | \
-       (((x) & 0x00ff000000000000) >> 40) | \
-       (((x) & 0x0000ff0000000000) >> 24) | \
-       (((x) & 0x000000ff00000000) >> 8 ) | \
-       (((x) & 0x00000000ff000000) << 8 ) | \
-       (((x) & 0x0000000000ff0000) << 24) | \
-       (((x) & 0x000000000000ff00) << 40) | \
-       (((x) & 0x00000000000000ff) << 56));
+  x = ((((x) & UINT64_C(0xff00000000000000)) >> 56) | \
+       (((x) & UINT64_C(0x00ff000000000000)) >> 40) | \
+       (((x) & UINT64_C(0x0000ff0000000000)) >> 24) | \
+       (((x) & UINT64_C(0x000000ff00000000)) >> 8 ) | \
+       (((x) & UINT64_C(0x00000000ff000000)) << 8 ) | \
+       (((x) & UINT64_C(0x0000000000ff0000)) << 24) | \
+       (((x) & UINT64_C(0x000000000000ff00)) << 40) | \
+       (((x) & UINT64_C(0x00000000000000ff)) << 56));
 #  define LE32_CPU(x) \
   x = ((((x) & 0xff000000) >> 24) | \
        (((x) & 0x00ff0000) >> 8 ) | \