From 6dd4d9fd31542a7ac753f412c632528a66cc38a3 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sun, 13 Nov 2016 01:47:11 -0500 Subject: aif2pcm: Use uint8_t and fix implicitly signed char. --- tools/aif2pcm/extended.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'tools/aif2pcm/extended.c') diff --git a/tools/aif2pcm/extended.c b/tools/aif2pcm/extended.c index 7ec74a887..94449164b 100644 --- a/tools/aif2pcm/extended.c +++ b/tools/aif2pcm/extended.c @@ -27,6 +27,7 @@ #include #include +#include /* * Infinite & NAN values @@ -62,7 +63,7 @@ * Write IEEE Extended Precision Numbers */ void -ieee754_write_extended(double in, unsigned char* out) +ieee754_write_extended(double in, uint8_t* out) { int sgn, exp, shift; double fraction, t; @@ -114,17 +115,17 @@ done: hexp = ((unsigned int) exp) & 0xFF; /* big endian */ - out[0] = ((unsigned char) sgn) << 7; - out[0] |= (unsigned char) lexp; - out[1] = (unsigned char) hexp; - out[2] = (unsigned char) (low >> 24); - out[3] = (unsigned char) ((low >> 16) & 0xFF); - out[4] = (unsigned char) ((low >> 8) & 0xFF); - out[5] = (unsigned char) (low & 0xFF); - out[6] = (unsigned char) (high >> 24); - out[7] = (unsigned char) ((high >> 16) & 0xFF); - out[8] = (unsigned char) ((high >> 8) & 0xFF); - out[9] = (unsigned char) (high & 0xFF); + out[0] = ((uint8_t) sgn) << 7; + out[0] |= (uint8_t) lexp; + out[1] = (uint8_t) hexp; + out[2] = (uint8_t) (low >> 24); + out[3] = (uint8_t) ((low >> 16) & 0xFF); + out[4] = (uint8_t) ((low >> 8) & 0xFF); + out[5] = (uint8_t) (low & 0xFF); + out[6] = (uint8_t) (high >> 24); + out[7] = (uint8_t) ((high >> 16) & 0xFF); + out[8] = (uint8_t) ((high >> 8) & 0xFF); + out[9] = (uint8_t) (high & 0xFF); return; } @@ -134,7 +135,7 @@ done: * Read IEEE Extended Precision Numbers */ double -ieee754_read_extended(unsigned char* in) +ieee754_read_extended(uint8_t* in) { int sgn, exp; unsigned long low, high; -- cgit v1.2.3