Fix some MSVC 2010 warnings (including one apparent bug in intern/elbeem/intern/solve...
authorAndrew Wiggin <ender79bl@gmail.com>
Sun, 25 Sep 2011 12:33:51 +0000 (12:33 +0000)
committerAndrew Wiggin <ender79bl@gmail.com>
Sun, 25 Sep 2011 12:33:51 +0000 (12:33 +0000)
intern/elbeem/intern/solver_relax.h
intern/smoke/intern/MERSENNETWISTER.h
source/blender/avi/intern/options.c
source/blender/blenlib/intern/pbvh.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/include/UI_interface_icons.h
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/file_draw.c

index f0910a6..54adf9f 100644 (file)
 #define  DEFAULT_STREAM  \
        m[dC] = RAC(ccel,dC); \
         \
-       if((!nbored & CFBnd)) { \
+       if(!(nbored & CFBnd)) { \
         \
        m[dN ] = CSRC_N ; m[dS ] = CSRC_S ; \
        m[dE ] = CSRC_E ; m[dW ] = CSRC_W ; \
index e976560..116568c 100644 (file)
@@ -132,7 +132,7 @@ protected:
        uint32 mixBits( const uint32& u, const uint32& v ) const
                { return hiBit(u) | loBits(v); }
        uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const
-               { return m ^ (mixBits(s0,s1)>>1) ^ (-loBit(s1) & 0x9908b0dfUL); }
+               { return m ^ (mixBits(s0,s1)>>1) ^ ((~loBit(s1) + 1) & 0x9908b0dfUL); }
        static uint32 hash( time_t t, clock_t c );
 };
 
index 96c6284..8993c1e 100644 (file)
@@ -46,6 +46,7 @@
 
 AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data) {
        int i;
+       int useconds;
 
        (void)stream; /* unused */
        
@@ -100,8 +101,9 @@ AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream,
                        break;
 
                case AVI_OPTION_FRAMERATE:
-                       if (1000000/(*((double *) opt_data)))
-                               movie->header->MicroSecPerFrame = 1000000/(*((double *) opt_data));
+                       useconds = (int)(1000000/(*((double *) opt_data)));
+                       if (useconds)
+                               movie->header->MicroSecPerFrame = useconds;
 
                        for (i=0; i < movie->header->Streams; i++) {
                                if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
index 0613765..57008af 100644 (file)
@@ -346,7 +346,7 @@ static int map_insert_vert(PBVH *bvh, GHash *map,
 
        if(!BLI_ghash_haskey(map, key)) {
                if(BLI_bitmap_get(bvh->vert_bitmap, vertex)) {
-                       value = SET_INT_IN_POINTER(-(*face_verts) - 1);
+                       value = SET_INT_IN_POINTER(~(*face_verts));
                        ++(*face_verts);
                }
                else {
index 04a6d15..f088c5e 100644 (file)
@@ -478,12 +478,12 @@ LinkNode *BLI_read_file_as_lines(const char *name)
        FILE *fp= fopen(name, "r");
        LinkNode *lines= NULL;
        char *buf;
-       int64_t size;
+       size_t size;
 
        if (!fp) return NULL;
                
        fseek(fp, 0, SEEK_END);
-       size= ftell(fp);
+       size= (size_t)ftell(fp);
        fseek(fp, 0, SEEK_SET);
 
        buf= MEM_mallocN(size, "file_as_lines");
index f80607a..6163fa0 100644 (file)
@@ -12070,7 +12070,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        /* Adaptive time step for particle systems */
                        ParticleSettings *part;
                        for (part = main->particle.first; part; part = part->id.next) {
-                               part->courant_target = 0.2;
+                               part->courant_target = 0.2f;
                                part->time_flag &= ~PART_TIME_AUTOSF;
                        }
                }
@@ -12089,7 +12089,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        if(sce->gm.recastData.cellheight == 0.0f)
                                sce->gm.recastData.cellheight = 0.2f;
                        if(sce->gm.recastData.agentmaxslope == 0.0f)
-                               sce->gm.recastData.agentmaxslope = M_PI/4;
+                               sce->gm.recastData.agentmaxslope = (float)M_PI/4;
                        if(sce->gm.recastData.agentmaxclimb == 0.0f)
                                sce->gm.recastData.agentmaxclimb = 0.9f;
                        if(sce->gm.recastData.agentheight == 0.0f)
index b6837a4..54400ac 100644 (file)
@@ -50,8 +50,8 @@ typedef struct IconFile {
 #define ICON_DEFAULT_HEIGHT 16
 #define ICON_DEFAULT_WIDTH     16
 
-#define ICON_DEFAULT_HEIGHT_SCALE      (UI_UNIT_Y * 0.8f)
-#define ICON_DEFAULT_WIDTH_SCALE       (UI_UNIT_X * 0.8f)
+#define ICON_DEFAULT_HEIGHT_SCALE ((int)(UI_UNIT_Y * 0.8f))
+#define ICON_DEFAULT_WIDTH_SCALE  ((int)(UI_UNIT_X * 0.8f))
 
 #define PREVIEW_DEFAULT_HEIGHT 96
 
index 5a965fc..1b9e3fd 100644 (file)
@@ -138,7 +138,7 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar)
        wmKeyMap *keymap;
        ListBase *lb;
 
-       const int prev_y_min= ar->v2d.cur.ymin; /* so resizing keeps the cursor visible */
+       const float prev_y_min= ar->v2d.cur.ymin; /* so resizing keeps the cursor visible */
 
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
index b2b7341..f7abb01 100644 (file)
@@ -520,7 +520,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
                        
                        file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE));
                } else {
-                       file_draw_icon(block, file->path, sx, sy-(UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_WIDTH_SCALE);
+                       file_draw_icon(block, file->path, sx, sy-(UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE);
                        sx += ICON_DEFAULT_WIDTH_SCALE + 4;
                }