aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2004-02-15 16:19:00 +0000
committerKim F. Storm2004-02-15 16:19:00 +0000
commitbd2311318862b58d894bf84fa364d36b0b79041e (patch)
tree80d6cdf6dd9f65ba4ee268ce1b275336d3fa22b4
parentc9159cb3f61f46d6180fc3144f357cfa02105e4e (diff)
downloademacs-bd2311318862b58d894bf84fa364d36b0b79041e.tar.gz
emacs-bd2311318862b58d894bf84fa364d36b0b79041e.zip
(init_fringe_bitmap) [MAC_OS, WORDS_BIG_ENDIAN]: Perform byte-swapping.
-rw-r--r--src/fringe.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/fringe.c b/src/fringe.c
index 82c7c191020..0ceffad34f4 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1017,7 +1017,9 @@ If WHICH overrides a standard fringe bitmap, the original bitmap is restored. *
1017 On X, we bit-swap the built-in bitmaps and reduce bitmap 1017 On X, we bit-swap the built-in bitmaps and reduce bitmap
1018 from short to char array if width is <= 8 bits. 1018 from short to char array if width is <= 8 bits.
1019 1019
1020 On W32 and MAC, there's no need to do this. 1020 On MAC with big-endian CPU, we need to byte-swap each short.
1021
1022 On W32 and MAC (little endian), there's no need to do this.
1021*/ 1023*/
1022 1024
1023void 1025void
@@ -1033,7 +1035,7 @@ init_fringe_bitmap (which, fb, once_p)
1033 = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ 1035 = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
1034 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ 1036 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
1035 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ 1037 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
1036 0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */ 1038 0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */
1037 unsigned short *bits = fb->bits; 1039 unsigned short *bits = fb->bits;
1038 int j; 1040 int j;
1039 1041
@@ -1061,7 +1063,16 @@ init_fringe_bitmap (which, fb, once_p)
1061 *bits++ = (b >> (16 - fb->width)); 1063 *bits++ = (b >> (16 - fb->width));
1062 } 1064 }
1063 } 1065 }
1064#endif 1066#endif /* HAVE_X_WINDOWS */
1067
1068#if defined (MAC_OS) && defined (WORDS_BIG_ENDIAN)
1069 unsigned short *bits = fb->bits;
1070 for (j = 0; j < fb->height; j++)
1071 {
1072 unsigned short b = *bits;
1073 *bits++ = ((b >> 8) & 0xff) | ((b & 0xff) << 8);
1074 }
1075#endif /* MAC_OS && WORDS_BIG_ENDIAN */
1065 } 1076 }
1066 1077
1067 if (!once_p) 1078 if (!once_p)
@@ -1339,7 +1350,7 @@ w32_reset_fringes ()
1339 rif->destroy_fringe_bitmap (bt); 1350 rif->destroy_fringe_bitmap (bt);
1340} 1351}
1341 1352
1342#endif 1353#endif /* HAVE_NTGUI */
1343 1354
1344#endif /* HAVE_WINDOW_SYSTEM */ 1355#endif /* HAVE_WINDOW_SYSTEM */
1345 1356