changeset 103062:06cf3e417172

(init_fringe_bitmap) [HAVE_X_WINDOWS && WORDS_BIG_ENDIAN]: Swap bytes in short integer if fringe bitmap width > 8.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Sat, 25 Apr 2009 00:26:16 +0000
parents eed4f6c22d3f
children 977770e57180
files src/fringe.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/fringe.c	Fri Apr 24 13:54:50 2009 +0000
+++ b/src/fringe.c	Sat Apr 25 00:26:16 2009 +0000
@@ -1369,7 +1369,11 @@
 				   | (swap_nibble[(b>>4) & 0xf] << 8)
 				   | (swap_nibble[(b>>8) & 0xf] << 4)
 				   | (swap_nibble[(b>>12) & 0xf]));
-	      *bits++ = (b >> (16 - fb->width));
+	      b >>= (16 - fb->width);
+#ifdef WORDS_BIG_ENDIAN
+	      b = ((b >> 8) | (b << 8));
+#endif
+	      *bits++ = b;
 	    }
 	}
 #endif /* HAVE_X_WINDOWS */