diff options
| author | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-03-18 14:40:37 +0000 |
|---|---|---|
| committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-03-18 14:40:37 +0000 |
| commit | de73cfeec11c7a8bb558d085ff85a6496271287e (patch) | |
| tree | 942449686f947e9a3b91953b792e007e06bbd7af /applications/codec | |
| parent | 49044ae2a8a246367f4eed093a0366f8c266373d (diff) | |
[1.5] Fix issues with big endian handling
Fixes issue 302
Diffstat (limited to 'applications/codec')
| -rw-r--r-- | applications/codec/convert.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/applications/codec/convert.c b/applications/codec/convert.c index b964c42d..082aa2cb 100644 --- a/applications/codec/convert.c +++ b/applications/codec/convert.c @@ -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 ); @@ -184,7 +184,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) { @@ -231,7 +231,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 |
