summaryrefslogtreecommitdiff
path: root/examples/cpp/encode
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2012-05-08 20:08:06 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2012-05-08 20:08:06 +1000
commit605f9208165e9da36753bc22d2b0ae75c90cc3dd (patch)
tree2db38b7b03eb24f0770c56121219b3bcdcf73eee /examples/cpp/encode
parent7c07a0ddfef1508cf2b79fffba102d182dd9dbc8 (diff)
downloadflac-605f9208165e9da36753bc22d2b0ae75c90cc3dd.tar.gz
Fix more compiler warnings.
Diffstat (limited to 'examples/cpp/encode')
-rw-r--r--examples/cpp/encode/file/main.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/cpp/encode/file/main.cpp b/examples/cpp/encode/file/main.cpp
index a6eeaa4e..007899e3 100644
--- a/examples/cpp/encode/file/main.cpp
+++ b/examples/cpp/encode/file/main.cpp
@@ -31,6 +31,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
#include "FLAC++/metadata.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 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_[2] = { pcm, pcm+READSIZE };
int main(int argc, char *argv[])
{
@@ -87,7 +90,7 @@ int main(int argc, char *argv[])
channels = 2;
bps = 16;
total_samples = (((((((unsigned)buffer[43] << 8) | buffer[42]) << 8) | buffer[41]) << 8) | buffer[40]) / 4;
-
+
/* check the encoder */
if(!encoder) {
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)
{
-#ifdef _MSC_VER
- 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
+ fprintf(stderr, "wrote %" PRIu64 " bytes, %" PRIu64 "/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate);
}