repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 1022d751617a80dfd2308450557b2c64c333946b:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 1022d751617a80dfd2308450557b2c64c333946b
Author: Marc Lehmann 
Date:   Mon Jan 3 18:42:58 2011 +0000

    fix alignment, as pointed out by exg

diff --git a/src/rxvtutil.h b/src/rxvtutil.h
index 7131a74966a9798013c1b1da4ec69c2b382e77de..
index ..852743722d6a7ce2e474186b263f6373494fb37b 100644
--- a/src/rxvtutil.h
+++ b/src/rxvtutil.h
@@ -44,16 +44,16 @@ using namespace std;
 #endif

 namespace byteorder {
-  static uint32_t e ()
+  static unsigned char e ()
   {
-    char c [4] = { 0x11, 0x22, 0x33, 0x44 };
-    return *(uint32_t *)c;
+    const uint32_t u = 0x11223344;
+    return *(unsigned char *)u;
   }

-  static bool big_endian    () { return e () == 0x11223344; };
-  static bool network       () { return big_endian ();      };
-  static bool little_endian () { return e () == 0x44332211; };
-  static bool vax           () { return little_endian ();   };
+  static bool big_endian    () { return e () == 0x11;     };
+  static bool network       () { return big_endian ();    };
+  static bool little_endian () { return e () == 0x44;     };
+  static bool vax           () { return little_endian (); };
 };

 // various utility functions

-----END OF PAGE-----