diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-01-14 17:26:39 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-01-14 17:46:02 +1100 |
commit | c6318e9dd3f7a91f40340911bcf57bf36768910e (patch) | |
tree | 19c44a2ef48655e1c81b1779a4d02813b6d0aa78 /src/libFLAC/md5.c | |
parent | 55721556161e6ab209f940f5023bc44b4051524a (diff) | |
download | flac-c6318e9dd3f7a91f40340911bcf57bf36768910e.tar.gz |
Purge usage of `unsigned` type
As pointed out by Ozkan Sezer, on some platforms `int32_t` is actually
a typedef for `long` so `unsigned` cannot be used interchangably with
`FLAC__uint32`. Fix is to switch from `unsigned` to explicit sized ISO
C types defined in <stdint.h>.
Diffstat (limited to 'src/libFLAC/md5.c')
-rw-r--r-- | src/libFLAC/md5.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libFLAC/md5.c b/src/libFLAC/md5.c index e9013a9a..d395e09e 100644 --- a/src/libFLAC/md5.c +++ b/src/libFLAC/md5.c @@ -136,7 +136,7 @@ static void FLAC__MD5Transform(FLAC__uint32 buf[4], FLAC__uint32 const in[16]) #if WORDS_BIGENDIAN //@@@@@@ OPT: use bswap/intrinsics -static void byteSwap(FLAC__uint32 *buf, unsigned words) +static void byteSwap(FLAC__uint32 *buf, uint32_t words) { register FLAC__uint32 x; do { @@ -175,7 +175,7 @@ static void byteSwapX16(FLAC__uint32 *buf) * Update context to reflect the concatenation of another buffer full * of bytes. */ -static void FLAC__MD5Update(FLAC__MD5Context *ctx, FLAC__byte const *buf, unsigned len) +static void FLAC__MD5Update(FLAC__MD5Context *ctx, FLAC__byte const *buf, uint32_t len) { FLAC__uint32 t; @@ -271,13 +271,13 @@ void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx) /* * Convert the incoming audio signal to a byte stream */ -static void format_input_(FLAC__multibyte *mbuf, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample) +static void format_input_(FLAC__multibyte *mbuf, const FLAC__int32 * const signal[], uint32_t channels, uint32_t samples, uint32_t bytes_per_sample) { FLAC__byte *buf_ = mbuf->p8; FLAC__int16 *buf16 = mbuf->p16; FLAC__int32 *buf32 = mbuf->p32; FLAC__int32 a_word; - unsigned channel, sample; + uint32_t channel, sample; /* Storage in the output buffer, buf, is little endian. */ @@ -488,7 +488,7 @@ static void format_input_(FLAC__multibyte *mbuf, const FLAC__int32 * const signa /* * Convert the incoming audio signal to a byte stream and FLAC__MD5Update it. */ -FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample) +FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], uint32_t channels, uint32_t samples, uint32_t bytes_per_sample) { const size_t bytes_needed = (size_t)channels * (size_t)samples * (size_t)bytes_per_sample; |