fwrite("WAVEfmt ", 1, 8, f) < 8 ||
!write_little_endian_uint32(f, 16) ||
!write_little_endian_uint16(f, 1) ||
- !write_little_endian_uint16(f, channels) ||
+ !write_little_endian_uint16(f, (FLAC__uint16)channels) ||
!write_little_endian_uint32(f, sample_rate) ||
!write_little_endian_uint32(f, sample_rate * channels * (bps/8)) ||
- !write_little_endian_uint16(f, channels * (bps/8)) || /* block align */
- !write_little_endian_uint16(f, bps) ||
+ !write_little_endian_uint16(f, (FLAC__uint16)(channels * (bps/8))) || /* block align */
+ !write_little_endian_uint16(f, (FLAC__uint16)bps) ||
fwrite("data", 1, 4, f) < 4 ||
!write_little_endian_uint32(f, total_size)
) {
/* write decoded PCM samples */
for(i = 0; i < frame->header.blocksize; i++) {
if(
- !write_little_endian_int16(f, buffer[0][i]) || /* left channel */
- !write_little_endian_int16(f, buffer[1][i]) /* right channel */
+ !write_little_endian_int16(f, (FLAC__int16)buffer[0][i]) || /* left channel */
+ !write_little_endian_int16(f, (FLAC__int16)buffer[1][i]) /* right channel */
) {
fprintf(stderr, "ERROR: write error\n");
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
#include <stdio.h>
#include <string.h>
#include "FLAC++/decoder.h"
-#if defined _MSC_VER || defined __MINGW32__\r
-#if _MSC_VER <= 1600 /* @@@ [2G limit] */\r
-#define fseeko fseek\r
-#define ftello ftell\r
-#endif\r
-#endif\r
+#if defined _MSC_VER || defined __MINGW32__
+#if _MSC_VER <= 1600 /* @@@ [2G limit] */
+#define fseeko fseek
+#define ftello ftell
+#endif
+#endif
+
+#ifdef _MSC_VER
+// warning C4800: 'int' : forcing to bool 'true' or 'false' (performance warning)
+#pragma warning ( disable : 4800 )
+#endif
class AutoFILE {
protected: