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/ogg_encoder_aspect.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/ogg_encoder_aspect.c')
-rw-r--r-- | src/libFLAC/ogg_encoder_aspect.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libFLAC/ogg_encoder_aspect.c b/src/libFLAC/ogg_encoder_aspect.c index ebd4614b..a655da93 100644 --- a/src/libFLAC/ogg_encoder_aspect.c +++ b/src/libFLAC/ogg_encoder_aspect.c @@ -72,7 +72,7 @@ void FLAC__ogg_encoder_aspect_set_serial_number(FLAC__OggEncoderAspect *aspect, aspect->serial_number = value; } -FLAC__bool FLAC__ogg_encoder_aspect_set_num_metadata(FLAC__OggEncoderAspect *aspect, unsigned value) +FLAC__bool FLAC__ogg_encoder_aspect_set_num_metadata(FLAC__OggEncoderAspect *aspect, uint32_t value) { if(value < (1u << FLAC__OGG_MAPPING_NUM_HEADERS_LEN)) { aspect->num_metadata = value; @@ -109,7 +109,7 @@ void FLAC__ogg_encoder_aspect_set_defaults(FLAC__OggEncoderAspect *aspect) * separate write callback for the fLaC magic, and then separate write * callbacks for each metadata block and audio frame. */ -FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(FLAC__OggEncoderAspect *aspect, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, FLAC__bool is_last_block, FLAC__OggEncoderAspectWriteCallbackProxy write_callback, void *encoder, void *client_data) +FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(FLAC__OggEncoderAspect *aspect, const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame, FLAC__bool is_last_block, FLAC__OggEncoderAspectWriteCallbackProxy write_callback, void *encoder, void *client_data) { /* WATCHOUT: * This depends on the behavior of FLAC__StreamEncoder that 'samples' @@ -170,14 +170,14 @@ FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(F /* add STREAMINFO */ memcpy(b, buffer, bytes); FLAC__ASSERT(b + bytes - synthetic_first_packet_body == sizeof(synthetic_first_packet_body)); - packet.packet = (unsigned char *)synthetic_first_packet_body; + packet.packet = (uint8_t *)synthetic_first_packet_body; packet.bytes = sizeof(synthetic_first_packet_body); packet.b_o_s = 1; aspect->is_first_packet = false; } else { - packet.packet = (unsigned char *)buffer; + packet.packet = (uint8_t *)buffer; packet.bytes = bytes; } |