Skip to content

Commit

Permalink
jpwl: Remove non-portable data type u_int16_t (fix issue #796) (#797)
Browse files Browse the repository at this point in the history
The type casts which used this data type can be removed by changing
the signature of function swap16. As this function is called with
unsigned variables, this change is reasonable.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil authored and malaterre committed Sep 13, 2016
1 parent ae2095e commit eebd59a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bin/jpwl/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,9 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,

#ifdef OPJ_BIG_ENDIAN

static inline int16_t swap16(int16_t x)
static inline uint16_t swap16(uint16_t x)
{
return((((u_int16_t)x & 0x00ffU) << 8) |
(((u_int16_t)x & 0xff00U) >> 8));
return(((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8));
}

#endif
Expand Down

0 comments on commit eebd59a

Please sign in to comment.