code cleanup: quiet msvc warnings
authorCampbell Barton <ideasman42@gmail.com>
Fri, 27 Apr 2012 03:01:27 +0000 (03:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 27 Apr 2012 03:01:27 +0000 (03:01 +0000)
CMakeLists.txt
source/blender/avi/intern/avi.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenlib/intern/fileops.c

index d216e617548073048991abdfdcfece0521c0f99c..6a9ca35cd0537909cbc633c01c6710b2a193261f 100644 (file)
@@ -827,7 +827,7 @@ elseif(WIN32)
                set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /MT /Zi" CACHE STRING "MSVC MT flags " FORCE)
 
                # most msvc warnings are C & C++
-               set(_WARNINGS "/W3 /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013")
+               set(_WARNINGS "/W3 /wd4018 /wd4244 /wd4305 /wd4800 /wd4181 /wd4065 /wd4267 /we4013")
                set(C_WARNINGS "${_WARNINGS}")
                set(CXX_WARNINGS "${_WARNINGS}")
                unset(_WARNINGS)
index 59ce879520edaeb63d3fef7e53bad1c843d0d8ae..2011ced96d98f0acfd4527f63997f601b7340e4f 100644 (file)
@@ -1002,7 +1002,7 @@ AviError AVI_write_frame (AviMovie *movie, int frame_num, ...)
 
                movie->entries[frame_num * (movie->header->Streams+1) + stream + 1].ChunkId = chunk.fcc;
                movie->entries[frame_num * (movie->header->Streams+1) + stream + 1].Flags = AVIIF_KEYFRAME;
-               movie->entries[frame_num * (movie->header->Streams+1) + stream + 1].Offset = ftell(movie->fp)-12L-movie->movi_offset;
+               movie->entries[frame_num * (movie->header->Streams+1) + stream + 1].Offset = (int)(ftell(movie->fp) - 12L - movie->movi_offset);
                movie->entries[frame_num * (movie->header->Streams+1) + stream + 1].Size = chunk.size;
 
                /* Write the chunk */
@@ -1024,8 +1024,8 @@ AviError AVI_write_frame (AviMovie *movie, int frame_num, ...)
 
        movie->entries[frame_num * (movie->header->Streams+1)].ChunkId = FCC("rec ");
        movie->entries[frame_num * (movie->header->Streams+1)].Flags = AVIIF_LIST;
-       movie->entries[frame_num * (movie->header->Streams+1)].Offset = rec_off-8L-movie->movi_offset;
-       movie->entries[frame_num * (movie->header->Streams+1)].Size = ftell(movie->fp)-(rec_off+4L);
+       movie->entries[frame_num * (movie->header->Streams+1)].Offset = (int)(rec_off - 8L - movie->movi_offset);
+       movie->entries[frame_num * (movie->header->Streams+1)].Size = (int)(ftell(movie->fp) - (rec_off + 4L));
 
        /* Update the record size */
        fseek (movie->fp, rec_off, SEEK_SET);
@@ -1044,7 +1044,7 @@ AviError AVI_close_compress (AviMovie *movie)
        int temp, movi_size, i;
 
        fseek (movie->fp, 0L, SEEK_END);
-       movi_size = ftell (movie->fp);
+       movi_size = (int)ftell(movie->fp);
 
        PUT_FCC ("idx1", movie->fp);
        PUT_FCCN ((movie->index_entries*(movie->header->Streams+1)*16), movie->fp);
@@ -1052,7 +1052,7 @@ AviError AVI_close_compress (AviMovie *movie)
        for (temp=0; temp < movie->index_entries*(movie->header->Streams+1); temp++)
                awrite (movie, &movie->entries[temp], 1, sizeof(AviIndexEntry), movie->fp, AVI_INDEXE);
 
-       temp = ftell (movie->fp);
+       temp = (int)ftell(movie->fp);
 
        fseek (movie->fp, AVI_RIFF_SOFF, SEEK_SET);
 
index dbcef9ad4c8394eeb8ff8358355ce01620b85e0b..2812592c69a33d0c71f76b501ed3dd03fa22e5c2 100644 (file)
@@ -2313,7 +2313,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
 
        if (timescale) {
                time= BKE_curframe(scene);
-               nexttime= BKE_frame_to_ctime(scene, CFRA+1);
+               nexttime = BKE_frame_to_ctime(scene, CFRA + 1.0f);
                
                *timescale= MAX2(nexttime - time, 0.0f);
        }
index 4b5ea44e97c2e5b33f6b5aff6dbd7f8dfc981c1c..8990f0f79d3a3ab76acc636c9b054d92abf07b77 100644 (file)
@@ -230,7 +230,7 @@ void *BLI_gzopen(const char *filename, const char *mode)
                GetShortPathNameW(filename_16,short_name_16, 256);
 
                for (i = 0; i < 256; i++) {
-                       short_name[i] = short_name_16[i];
+                       short_name[i] = (char)short_name_16[i];
                }
 
                gzfile = gzopen(short_name,mode);