From 7345fc4113d35ddba7613c57051c2510f373b0f8 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 13 Jul 2016 10:42:44 +0200 Subject: [PATCH] jpwl: Remove non-portable data type u_int16_t (fix issue #796) 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 --- src/bin/jpwl/convert.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/jpwl/convert.c b/src/bin/jpwl/convert.c index bf7b56415..9db7e955c 100644 --- a/src/bin/jpwl/convert.c +++ b/src/bin/jpwl/convert.c @@ -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