Fix more compiler warnings.
This commit is contained in:
parent
7c07a0ddfe
commit
605f920816
@ -30,6 +30,10 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define __STDC_FORMAT_MACROS
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "FLAC++/decoder.h"
|
#include "FLAC++/decoder.h"
|
||||||
|
|
||||||
static FLAC__uint64 total_samples = 0;
|
static FLAC__uint64 total_samples = 0;
|
||||||
@ -175,11 +179,7 @@ void OurDecoder::metadata_callback(const ::FLAC__StreamMetadata *metadata)
|
|||||||
fprintf(stderr, "sample rate : %u Hz\n", sample_rate);
|
fprintf(stderr, "sample rate : %u Hz\n", sample_rate);
|
||||||
fprintf(stderr, "channels : %u\n", channels);
|
fprintf(stderr, "channels : %u\n", channels);
|
||||||
fprintf(stderr, "bits per sample: %u\n", bps);
|
fprintf(stderr, "bits per sample: %u\n", bps);
|
||||||
#ifdef _MSC_VER
|
fprintf(stderr, "total samples : %" PRIu64 "\n", total_samples);
|
||||||
fprintf(stderr, "total samples : %I64u\n", total_samples);
|
|
||||||
#else
|
|
||||||
fprintf(stderr, "total samples : %llu\n", total_samples);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#define __STDC_FORMAT_MACROS
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "FLAC++/metadata.h"
|
#include "FLAC++/metadata.h"
|
||||||
#include "FLAC++/encoder.h"
|
#include "FLAC++/encoder.h"
|
||||||
|
|
||||||
@ -48,7 +52,6 @@ protected:
|
|||||||
static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */
|
static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */
|
||||||
static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data into here */
|
static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data into here */
|
||||||
static FLAC__int32 pcm[READSIZE/*samples*/ * 2/*channels*/];
|
static FLAC__int32 pcm[READSIZE/*samples*/ * 2/*channels*/];
|
||||||
static FLAC__int32 *pcm_[2] = { pcm, pcm+READSIZE };
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -87,7 +90,7 @@ int main(int argc, char *argv[])
|
|||||||
channels = 2;
|
channels = 2;
|
||||||
bps = 16;
|
bps = 16;
|
||||||
total_samples = (((((((unsigned)buffer[43] << 8) | buffer[42]) << 8) | buffer[41]) << 8) | buffer[40]) / 4;
|
total_samples = (((((((unsigned)buffer[43] << 8) | buffer[42]) << 8) | buffer[41]) << 8) | buffer[40]) / 4;
|
||||||
|
|
||||||
/* check the encoder */
|
/* check the encoder */
|
||||||
if(!encoder) {
|
if(!encoder) {
|
||||||
fprintf(stderr, "ERROR: allocating encoder\n");
|
fprintf(stderr, "ERROR: allocating encoder\n");
|
||||||
@ -170,9 +173,5 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
void OurEncoder::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate)
|
void OurEncoder::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
fprintf(stderr, "wrote %" PRIu64 " bytes, %" PRIu64 "/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate);
|
||||||
fprintf(stderr, "wrote %I64u bytes, %I64u/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate);
|
|
||||||
#else
|
|
||||||
fprintf(stderr, "wrote %llu bytes, %llu/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -2020,7 +2020,7 @@ bool test_metadata_object_picture()
|
|||||||
printf("testing Picture::set_colors()... +\n");
|
printf("testing Picture::set_colors()... +\n");
|
||||||
printf(" Picture::get_colors()... ");
|
printf(" Picture::get_colors()... ");
|
||||||
block.set_colors(1u>16);
|
block.set_colors(1u>16);
|
||||||
if(block.get_colors() != 1u>16)
|
if(block.get_colors() != (1u>16))
|
||||||
return die_("value mismatch, expected 2^16");
|
return die_("value mismatch, expected 2^16");
|
||||||
printf("OK\n");
|
printf("OK\n");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user