Commit 09b82248 authored by Rosen Penev's avatar Rosen Penev Committed by Erik de Castro Lopo
Browse files

Fix cppcheck warnings


Signed-off-by: Erik de Castro Lopo's avatarErik de Castro Lopo <erikd@mega-nerd.com>
parent ada48f59
......@@ -306,7 +306,7 @@ void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out)
if(i < br->consumed_words || (i == br->consumed_words && j < br->consumed_bits))
fprintf(out, ".");
else
fprintf(out, "%01u", br->buffer[i] & ((brword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
fprintf(out, "%01d", br->buffer[i] & ((brword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
fprintf(out, "\n");
}
if(br->bytes > 0) {
......@@ -315,7 +315,7 @@ void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out)
if(i < br->consumed_words || (i == br->consumed_words && j < br->consumed_bits))
fprintf(out, ".");
else
fprintf(out, "%01u", br->buffer[i] & ((brword)1 << (br->bytes*8-j-1)) ? 1:0);
fprintf(out, "%01d", br->buffer[i] & ((brword)1 << (br->bytes*8-j-1)) ? 1:0);
fprintf(out, "\n");
}
}
......
......@@ -201,13 +201,13 @@ void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out)
for(i = 0; i < bw->words; i++) {
fprintf(out, "%08X: ", i);
for(j = 0; j < FLAC__BITS_PER_WORD; j++)
fprintf(out, "%01u", bw->buffer[i] & ((bwword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
fprintf(out, "%01d", bw->buffer[i] & ((bwword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
fprintf(out, "\n");
}
if(bw->bits > 0) {
fprintf(out, "%08X: ", i);
for(j = 0; j < bw->bits; j++)
fprintf(out, "%01u", bw->accum & ((bwword)1 << (bw->bits-j-1)) ? 1:0);
fprintf(out, "%01d", bw->accum & ((bwword)1 << (bw->bits-j-1)) ? 1:0);
fprintf(out, "\n");
}
}
......
......@@ -324,7 +324,7 @@ void FLAC_XMMS__play_file(char *filename)
}
else {
/*@@@ need some error here like wa2: MessageBox(mod_.hMainWindow, "ERROR: plugin can only handle 8/16-bit samples\n", "ERROR: plugin can only handle 8/16-bit samples", 0); */
fprintf(stderr, "libxmms-flac: can't handle %d bit output\n", stream_data_.bits_per_sample);
fprintf(stderr, "libxmms-flac: can't handle %u bit output\n", stream_data_.bits_per_sample);
safe_decoder_finish_(decoder_);
return;
}
......
......@@ -438,7 +438,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
printf("testing get_max_lpc_order()... ");
if(encoder->get_max_lpc_order() != 0) {
printf("FAILED, expected %u, got %u\n", 0, encoder->get_max_lpc_order());
printf("FAILED, expected %d, got %u\n", 0, encoder->get_max_lpc_order());
return false;
}
printf("OK\n");
......@@ -471,21 +471,21 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
printf("testing get_min_residual_partition_order()... ");
if(encoder->get_min_residual_partition_order() != 0) {
printf("FAILED, expected %u, got %u\n", 0, encoder->get_min_residual_partition_order());
printf("FAILED, expected %d, got %u\n", 0, encoder->get_min_residual_partition_order());
return false;
}
printf("OK\n");
printf("testing get_max_residual_partition_order()... ");
if(encoder->get_max_residual_partition_order() != 0) {
printf("FAILED, expected %u, got %u\n", 0, encoder->get_max_residual_partition_order());
printf("FAILED, expected %d, got %u\n", 0, encoder->get_max_residual_partition_order());
return false;
}
printf("OK\n");
printf("testing get_rice_parameter_search_dist()... ");
if(encoder->get_rice_parameter_search_dist() != 0) {
printf("FAILED, expected %u, got %u\n", 0, encoder->get_rice_parameter_search_dist());
printf("FAILED, expected %d, got %u\n", 0, encoder->get_rice_parameter_search_dist());
return false;
}
printf("OK\n");
......
......@@ -282,10 +282,10 @@ static void stream_decoder_metadata_callback_(const FLAC__StreamDecoder *decoder
return;
if (metadata->type == FLAC__METADATA_TYPE_APPLICATION) {
printf ("%d ('%c%c%c%c')... ", dcd->current_metadata_number, metadata->data.application.id [0], metadata->data.application.id [1], metadata->data.application.id [2], metadata->data.application.id [3]);
printf ("%u ('%c%c%c%c')... ", dcd->current_metadata_number, metadata->data.application.id [0], metadata->data.application.id [1], metadata->data.application.id [2], metadata->data.application.id [3]);
}
else {
printf("%d... ", dcd->current_metadata_number);
printf("%u... ", dcd->current_metadata_number);
}
fflush(stdout);
......
......@@ -397,7 +397,7 @@ static FLAC__bool test_stream_encoder(Layer layer, FLAC__bool is_ogg)
printf("testing FLAC__stream_encoder_get_max_lpc_order()... ");
if(FLAC__stream_encoder_get_max_lpc_order(encoder) != 0) {
printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_max_lpc_order(encoder));
printf("FAILED, expected %d, got %u\n", 0, FLAC__stream_encoder_get_max_lpc_order(encoder));
return false;
}
printf("OK\n");
......@@ -430,21 +430,21 @@ static FLAC__bool test_stream_encoder(Layer layer, FLAC__bool is_ogg)
printf("testing FLAC__stream_encoder_get_min_residual_partition_order()... ");
if(FLAC__stream_encoder_get_min_residual_partition_order(encoder) != 0) {
printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_min_residual_partition_order(encoder));
printf("FAILED, expected %d, got %u\n", 0, FLAC__stream_encoder_get_min_residual_partition_order(encoder));
return false;
}
printf("OK\n");
printf("testing FLAC__stream_encoder_get_max_residual_partition_order()... ");
if(FLAC__stream_encoder_get_max_residual_partition_order(encoder) != 0) {
printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_max_residual_partition_order(encoder));
printf("FAILED, expected %d, got %u\n", 0, FLAC__stream_encoder_get_max_residual_partition_order(encoder));
return false;
}
printf("OK\n");
printf("testing FLAC__stream_encoder_get_rice_parameter_search_dist()... ");
if(FLAC__stream_encoder_get_rice_parameter_search_dist(encoder) != 0) {
printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_rice_parameter_search_dist(encoder));
printf("FAILED, expected %d, got %u\n", 0, FLAC__stream_encoder_get_rice_parameter_search_dist(encoder));
return false;
}
printf("OK\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment