summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2016-07-14 10:49:17 +0200
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2016-09-13 11:00:07 +0200
commiteebd59a6d694ab88ef1dde9bf3187a5f8053f345 (patch)
tree31f61395027bb79f140c370fe4a353eed9e232ac
parentae2095ef1467bc3abc3d1884e9a5f0e3dda2f8f1 (diff)
jpwl: Remove non-portable data type u_int16_t (fix issue #796) (#797)
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 <sw@weilnetz.de>
-rw-r--r--src/bin/jpwl/convert.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bin/jpwl/convert.c b/src/bin/jpwl/convert.c
index bf7b5641..9db7e955 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