msvc fixes
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 12 Sep 2007 03:01:17 +0000 (03:01 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 12 Sep 2007 03:01:17 +0000 (03:01 +0000)
examples/c/decode/file/main.c
src/utils/flacdiff/main.cpp

index 82d56c3..6448ba5 100644 (file)
@@ -128,11 +128,11 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder
                        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)
                ) {
@@ -144,8 +144,8 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder
        /* 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;
index 5fc961e..1aec559 100644 (file)
 #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: