[trunk] Update big endian handling no such thing as WORDS_BIGENDIAN (prefer OPJ_BIG_E...
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Tue, 18 Mar 2014 14:37:33 +0000 (14:37 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Tue, 18 Mar 2014 14:37:33 +0000 (14:37 +0000)
Update issue 302

src/bin/jp2/convert.c
src/bin/jpwl/convert.c

index 3588700b75e89bebf76ab517e8c5ec8f7624f59a..2ab6d628ef2f1db2d18b4eac161efeaf2efe0430 100644 (file)
@@ -94,7 +94,7 @@ struct tga_header
 
 static unsigned short get_ushort(unsigned short val) {
 
-#ifdef WORDS_BIGENDIAN
+#ifdef OPJ_BIG_ENDIAN
     return( ((val & 0xff) << 8) + (val >> 8) );
 #else
     return( val );
@@ -181,7 +181,7 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,
     return 1;
 }
 
-#if WORDS_BIGENDIAN == 1
+#ifdef OPJ_BIG_ENDIAN
 
 static INLINE int16_t swap16(int16_t x)
 {
@@ -228,7 +228,7 @@ static int tga_writeheader(FILE *fp, int bits_per_pixel, int width, int height,
     image_w = (unsigned short)width;
     image_h = (unsigned short) height;
 
-#if WORDS_BIGENDIAN == 0
+#ifndef OPJ_BIG_ENDIAN
     if(fwrite(&image_w, 2, 1, fp) != 1) goto fails;
     if(fwrite(&image_h, 2, 1, fp) != 1) goto fails;
 #else
index 98f3c62c2641c66124a4f858c95b6db1a3298196..5012325765e1df99c16da516fbf8e029606a4645 100644 (file)
@@ -94,7 +94,7 @@ struct tga_header
 
 static unsigned short get_ushort(unsigned short val) {
 
-#ifdef WORDS_BIGENDIAN
+#ifdef OPJ_BIG_ENDIAN
        return( ((val & 0xff) << 8) + (val >> 8) );
 #else
     return( val );
@@ -179,7 +179,7 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,
        return 1;
 }
 
-#if WORDS_BIGENDIAN == 1
+#ifdef OPJ_BIG_ENDIAN
 
 static inline int16_t swap16(int16_t x)
 {
@@ -226,7 +226,7 @@ static int tga_writeheader(FILE *fp, int bits_per_pixel, int width, int height,
        image_w = (unsigned short)width;
        image_h = (unsigned short) height;
 
-#if WORDS_BIGENDIAN == 0
+#ifndef OPJ_BIG_ENDIAN
        if(fwrite(&image_w, 2, 1, fp) != 1) goto fails;
        if(fwrite(&image_h, 2, 1, fp) != 1) goto fails;
 #else