mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
fix compiler warnings
This commit is contained in:
@@ -632,7 +632,7 @@ FLAC__bool FLAC__bitbuffer_write_zeroes(FLAC__BitBuffer *bb, unsigned bits)
|
||||
return true;
|
||||
}
|
||||
|
||||
FLaC__INLINE FLAC__bool FLAC__bitbuffer_write_raw_uint32(FLAC__BitBuffer *bb, FLAC__uint32 val, unsigned bits)
|
||||
FLAC__bool FLAC__bitbuffer_write_raw_uint32(FLAC__BitBuffer *bb, FLAC__uint32 val, unsigned bits)
|
||||
{
|
||||
unsigned n, k;
|
||||
|
||||
|
||||
@@ -58,5 +58,5 @@ void FLAC__ogg_encoder_aspect_finish(FLAC__OggEncoderAspect *aspect);
|
||||
|
||||
typedef FLAC__StreamEncoderWriteStatus (*FLAC__OggEncoderAspectWriteCallbackProxy)(const void *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data);
|
||||
|
||||
FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(FLAC__OggEncoderAspect *aspect, const FLAC__uint64 total_samples_estimate, 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, unsigned samples, unsigned current_frame, FLAC__bool is_last_block, FLAC__OggEncoderAspectWriteCallbackProxy write_callback, void *encoder, void *client_data);
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,6 @@ static FLAC__bool is_big_endian_host_;
|
||||
* reflect the addition of 16 longwords of new data. MD5Update blocks
|
||||
* the data and converts bytes into longwords for this routine.
|
||||
*/
|
||||
FLaC__INLINE
|
||||
void
|
||||
FLAC__MD5Transform(FLAC__uint32 buf[4], FLAC__uint32 const in[16])
|
||||
{
|
||||
|
||||
@@ -2925,8 +2925,9 @@ FLAC__bool copy_n_bytes_from_file_(FILE *file, FILE *tempfile, off_t bytes, FLAC
|
||||
FLAC__byte buffer[8192];
|
||||
size_t n;
|
||||
|
||||
FLAC__ASSERT(bytes >= 0);
|
||||
while(bytes > 0) {
|
||||
n = min(sizeof(buffer), bytes);
|
||||
n = min(sizeof(buffer), (size_t)bytes);
|
||||
if(fread(buffer, 1, n, file) != n) {
|
||||
*status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR;
|
||||
return false;
|
||||
@@ -2946,8 +2947,9 @@ FLAC__bool copy_n_bytes_from_file_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Re
|
||||
FLAC__byte buffer[8192];
|
||||
size_t n;
|
||||
|
||||
FLAC__ASSERT(bytes >= 0);
|
||||
while(bytes > 0) {
|
||||
n = min(sizeof(buffer), bytes);
|
||||
n = min(sizeof(buffer), (size_t)bytes);
|
||||
if(read_cb(buffer, 1, n, handle) != n) {
|
||||
*status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR;
|
||||
return false;
|
||||
|
||||
@@ -108,7 +108,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__uint64 total_samples_estimate, 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, unsigned samples, unsigned 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'
|
||||
|
||||
@@ -2707,7 +2707,6 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const
|
||||
if(encoder->private_->is_ogg) {
|
||||
status = FLAC__ogg_encoder_aspect_write_callback_wrapper(
|
||||
&encoder->protected_->ogg_encoder_aspect,
|
||||
FLAC__stream_encoder_get_total_samples_estimate(encoder),
|
||||
buffer,
|
||||
bytes,
|
||||
samples,
|
||||
|
||||
@@ -251,6 +251,8 @@ FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitBuff
|
||||
blocksize_hint = u = 6;
|
||||
else if(header->blocksize <= 0x10000)
|
||||
blocksize_hint = u = 7;
|
||||
else
|
||||
u = 0;
|
||||
break;
|
||||
}
|
||||
if(!FLAC__bitbuffer_write_raw_uint32(bb, u, FLAC__FRAME_HEADER_BLOCK_SIZE_LEN))
|
||||
|
||||
Reference in New Issue
Block a user