Skip to content

Commit

Permalink
Properly check for Big Endian
Browse files Browse the repository at this point in the history
  • Loading branch information
roehling committed Aug 5, 2023
1 parent c319663 commit ed3962f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tinyexr.h
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ static void cpy2(unsigned short *dst_val, const unsigned short *src_val) {
}

static void swap2(unsigned short *val) {
#ifdef TINYEXR_LITTLE_ENDIAN
#if TINYEXR_LITTLE_ENDIAN
(void)val;
#else
unsigned short tmp = *val;
Expand Down Expand Up @@ -839,7 +839,7 @@ static void cpy4(float *dst_val, const float *src_val) {
#endif

static void swap4(unsigned int *val) {
#ifdef TINYEXR_LITTLE_ENDIAN
#if TINYEXR_LITTLE_ENDIAN
(void)val;
#else
unsigned int tmp = *val;
Expand All @@ -854,7 +854,7 @@ static void swap4(unsigned int *val) {
}

static void swap4(int *val) {
#ifdef TINYEXR_LITTLE_ENDIAN
#if TINYEXR_LITTLE_ENDIAN
(void)val;
#else
int tmp = *val;
Expand All @@ -869,7 +869,7 @@ static void swap4(int *val) {
}

static void swap4(float *val) {
#ifdef TINYEXR_LITTLE_ENDIAN
#if TINYEXR_LITTLE_ENDIAN
(void)val;
#else
float tmp = *val;
Expand Down Expand Up @@ -900,7 +900,7 @@ static void cpy8(tinyexr::tinyexr_uint64 *dst_val, const tinyexr::tinyexr_uint64
#endif

static void swap8(tinyexr::tinyexr_uint64 *val) {
#ifdef TINYEXR_LITTLE_ENDIAN
#if TINYEXR_LITTLE_ENDIAN
(void)val;
#else
tinyexr::tinyexr_uint64 tmp = (*val);
Expand Down

0 comments on commit ed3962f

Please sign in to comment.