diff src/glyphs-x.c @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents c9fe270a4101
children c6de09ad3017
line wrap: on
line diff
--- a/src/glyphs-x.c	Mon Aug 13 10:38:47 2007 +0200
+++ b/src/glyphs-x.c	Mon Aug 13 10:39:40 2007 +0200
@@ -198,11 +198,10 @@
 	      gr = *ip++;
 	      bl = *ip++;
 	      conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)];
-#ifdef WORDS_BIGENDIAN
-	      for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
-#else
-	      for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
-#endif
+	      if (outimg->byte_order == MSBFirst)
+		for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
+	      else
+		for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
 	    }
 	}
       xfree(qtable);
@@ -267,11 +266,10 @@
 		bl = *ip++ >> (8 - bbits);
 
 	      conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift);
-#ifdef WORDS_BIGENDIAN
-	      for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
-#else
-	      for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
-#endif
+	      if (outimg->byte_order == MSBFirst)
+		for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
+	      else
+		for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
 	    }
 	}
     }