2.5 - Silencing more MSVC warnings
authorJoshua Leung <aligorith@gmail.com>
Fri, 2 Jan 2009 06:03:53 +0000 (06:03 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 2 Jan 2009 06:03:53 +0000 (06:03 +0000)
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_header.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_ipo/space_ipo.c

index 5ac9804a47de7f933ab110b81e25903758ccd535..41267738cf5b2dcd0ccb08695818b928a25bc556 100644 (file)
@@ -846,7 +846,7 @@ static int fd_read_from_memory(FileData *filedata, void *buffer, int size)
        return (readsize);
 }
 
-static int fd_read_from_memfile(FileData *filedata, void *buffer, int size)
+static int fd_read_from_memfile(FileData *filedata, void *buffer, unsigned int size)
 {
        static unsigned int seek= 1<<30;        /* the current position */
        static unsigned int offset= 0;          /* size of previous chunks */
@@ -2889,7 +2889,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
        
        if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) {
                TFace *tf= mesh->tface;
-               int i;
+               unsigned int i;
 
                for (i=0; i< (mesh->pv ? mesh->pv->totface : mesh->totface); i++, tf++) {
                        SWITCH_INT(tf->col[0]);
@@ -7372,7 +7372,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Material *ma;
                
                for(; cam; cam= cam->id.next) {
-                       cam->angle= 360.0f * atan(16.0f/cam->lens) / M_PI;
+                       cam->angle= 360.0f * (float)atan(16.0f/cam->lens) / (float)M_PI;
                }
 
                for(ma=main->mat.first; ma; ma= ma->id.next) {
@@ -7497,7 +7497,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                else
                                        la->ray_samp_method = LA_SAMP_HALTON;
                                
-                               la->adapt_thresh = 0.001;
+                               la->adapt_thresh = 0.001f;
                        }
                }
        }
@@ -7604,14 +7604,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                        for (sl= sa->spacedata.first; sl; sl= sl->next) {
                                                if(sl->spacetype==SPACE_IMASEL) {
                                                        SpaceImaSel *simasel= (SpaceImaSel*) sl;
-                                                       simasel->blockscale= 0.7;
+                                                       simasel->blockscale= 0.7f;
                                                        /* view 2D */
-                                                       simasel->v2d.tot.xmin=  -10.0;
-                                                       simasel->v2d.tot.ymin=  -10.0;
+                                                       simasel->v2d.tot.xmin=  -10.0f;
+                                                       simasel->v2d.tot.ymin=  -10.0f;
                                                        simasel->v2d.tot.xmax= (float)sa->winx + 10.0f;
                                                        simasel->v2d.tot.ymax= (float)sa->winy + 10.0f;                                         
-                                                       simasel->v2d.cur.xmin=  0.0;
-                                                       simasel->v2d.cur.ymin=  0.0;
+                                                       simasel->v2d.cur.xmin=  0.0f;
+                                                       simasel->v2d.cur.ymin=  0.0f;
                                                        simasel->v2d.cur.xmax= (float)sa->winx;
                                                        simasel->v2d.cur.ymax= (float)sa->winy;                                         
                                                        simasel->v2d.min[0]= 1.0;
@@ -7690,11 +7690,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                
                for(ma=main->mat.first; ma; ma= ma->id.next) {
                        if(ma->samp_gloss_mir == 0) {
-                               ma->gloss_mir = ma->gloss_tra= 1.0;
-                               ma->aniso_gloss_mir = 1.0;
+                               ma->gloss_mir = ma->gloss_tra= 1.0f;
+                               ma->aniso_gloss_mir = 1.0f;
                                ma->samp_gloss_mir = ma->samp_gloss_tra= 18;
-                               ma->adapt_thresh_mir = ma->adapt_thresh_tra = 0.005;
-                               ma->dist_mir = 0.0;
+                               ma->adapt_thresh_mir = ma->adapt_thresh_tra = 0.005f;
+                               ma->dist_mir = 0.0f;
                                ma->fadeto_mir = MA_RAYMIR_FADETOSKY;
                        }
 
@@ -7833,9 +7833,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                /* foreground color needs to be somthing other then black */
                Scene *sce;
                for(sce= main->scene.first; sce; sce=sce->id.next) {
-                       sce->r.fg_stamp[0] = sce->r.fg_stamp[1] = sce->r.fg_stamp[2] = 0.8;
-                       sce->r.fg_stamp[3] = 1.0; /* dont use text alpha yet */
-                       sce->r.bg_stamp[3] = 0.25; /* make sure the background has full alpha */
+                       sce->r.fg_stamp[0] = sce->r.fg_stamp[1] = sce->r.fg_stamp[2] = 0.8f;
+                       sce->r.fg_stamp[3] = 1.0f; /* dont use text alpha yet */
+                       sce->r.bg_stamp[3] = 0.25f; /* make sure the background has full alpha */
                }
        }
 
@@ -8150,7 +8150,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                for(sce=main->scene.first; sce; sce=sce->id.next) {
                        SEQ_BEGIN(sce->ed, seq) {
                                if (seq->blend_mode == 0)
-                                       seq->blend_opacity = 100.0;
+                                       seq->blend_opacity = 100.0f;
                        }
                        SEQ_END
                }
@@ -8240,7 +8240,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Object *ob;
                for(ob = main->object.first; ob; ob= ob->id.next) {
                        if(ob->pd && (ob->pd->forcefield == PFIELD_WIND))
-                               ob->pd->f_noise = 0.0;
+                               ob->pd->f_noise = 0.0f;
                }
        }
 
@@ -8248,7 +8248,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Object *ob;
                for(ob = main->object.first; ob; ob= ob->id.next) {
                        ob->gameflag |= OB_COLLISION;
-                       ob->margin = 0.06;
+                       ob->margin = 0.06f;
                }
        }
 
@@ -8361,16 +8361,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                for(la=main->lamp.first; la; la= la->id.next) {
                        if(la->atm_turbidity == 0.0) {
                                la->sun_effect_type = 0;
-                               la->horizon_brightness = 1.0;
-                               la->spread = 1.0;
-                               la->sun_brightness = 1.0;
-                               la->sun_size = 1.0;
-                               la->backscattered_light = 1.0;
-                               la->atm_turbidity = 2.0;
-                               la->atm_inscattering_factor = 1.0;
-                               la->atm_extinction_factor = 1.0;
-                               la->atm_distance_factor = 1.0;
-                               la->sun_intensity = 1.0;
+                               la->horizon_brightness = 1.0f;
+                               la->spread = 1.0f;
+                               la->sun_brightness = 1.0f;
+                               la->sun_size = 1.0f;
+                               la->backscattered_light = 1.0f;
+                               la->atm_turbidity = 2.0f;
+                               la->atm_inscattering_factor = 1.0f;
+                               la->atm_extinction_factor = 1.0f;
+                               la->atm_distance_factor = 1.0f;
+                               la->sun_intensity = 1.0f;
                        }
                }
        }
index 91daa6bf54185f9fcd4889f6dfeca002058a4ce8..e7d803e438a7cc37f44006a2f38cd8402c77cad8 100644 (file)
@@ -85,7 +85,7 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
                sprintf(str, "   %.2f", FRA2TIME(CFRA));
        else 
                sprintf(str, "   %d", CFRA);
-       slen= UI_GetStringWidth(G.font, str, 0) - 1;
+       slen= (short)UI_GetStringWidth(G.font, str, 0) - 1;
        
        /* get starting coordinates for drawing */
        x= cfra * xscale;
index e6ccc7b91051552e13648218e4bde263ed204b6e..3b41da56b509e72bb1de30094717cb903163aae2 100644 (file)
@@ -247,10 +247,10 @@ static short snap_bezier_nearest(BeztEditData *bed, BezTriple *bezt)
 static short snap_bezier_nearestsec(BeztEditData *bed, BezTriple *bezt)
 {
        const Scene *scene= bed->scene;
-       const float secf = FPS;
+       const float secf = (float)FPS;
        
        if (bezt->f2 & SELECT)
-               bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]/secf + 0.5f) * secf);
+               bezt->vec[1][0]= ((float)floor(bezt->vec[1][0]/secf + 0.5f) * secf);
        return 0;
 }
 
@@ -398,7 +398,7 @@ void snap_cfra_ipo_keys(BeztEditData *bed, Ipo *ipo, short mode)
                for (icu= ipo->curve.first; icu; icu= icu->next) {
                        for (a=0, bezt=icu->bezt; a < icu->totvert; a++, bezt++) {
                                if (BEZSELECTED(bezt)) {
-                                       cfra += bezt->vec[1][0];
+                                       cfra += (int)floor(bezt->vec[1][0] + 0.5f);
                                        tot++;
                                }
                        }
index 4352f64ff47db26d0fcbd5015168360ddc391fdf..ef3a9f760c8491b79eb53baa202a0ca2cdf1d4e5 100644 (file)
@@ -728,7 +728,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
                                
                                /* y-axis transform */
                                dist = (v2d->mask.ymax - v2d->mask.ymin) / 2.0f;
-                               dy= 1.0f - ((float)fabs(vzd->lasty - dist) + 2.0) / ((float)fabs(event->y - dist) + 2.0f);
+                               dy= 1.0f - ((float)fabs(vzd->lasty - dist) + 2.0f) / ((float)fabs(event->y - dist) + 2.0f);
                                dy*= 0.5f * (v2d->cur.ymax - v2d->cur.ymin);
                        }
                        else {
index 8db623c726765e15f6a8788318554d1c7b1a9a4c..a3ec3a65af07593b9a580ddf96269585c23d3773 100644 (file)
@@ -422,7 +422,7 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
                /* don't use totrect set, as the width stays the same 
                 * (NOTE: this is ok here, the configuration is pretty straightforward) 
                 */
-               v2d->tot.ymin= -height;
+               v2d->tot.ymin= (float)(-height);
        }
        
        /* loop through channels, and set up drawing depending on their type  */        
@@ -1152,7 +1152,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
                /* don't use totrect set, as the width stays the same 
                 * (NOTE: this is ok here, the configuration is pretty straightforward) 
                 */
-               v2d->tot.ymin= -height;
+               v2d->tot.ymin= (float)(-height);
        }
        
        /* first backdrop strips */
index d6c0fdcef375390f0a3310e1cc852dcdc2434c44..9522ce04abfb43770d7f753aa96d967aa4491074 100644 (file)
@@ -205,7 +205,7 @@ static int actkeys_viewall_exec(bContext *C, wmOperator *op)
        
        /* set vertical range */
        v2d->cur.ymax= 0.0f;
-       v2d->cur.ymin= -(v2d->mask.ymax - v2d->mask.ymin);
+       v2d->cur.ymin= (float)-(v2d->mask.ymax - v2d->mask.ymin);
        
        /* do View2D syncing */
        UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY);
@@ -1307,7 +1307,7 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
                
                /* store marker's time (if available) */
                if (marker)
-                       bed.f1= marker->frame;
+                       bed.f1= (float)marker->frame;
                else
                        return;
        }
index dbcdc0adb1ef8ee6da34204c9fa2a91112c70248..406c9bf2147f83440add7acac12b2748b581620c 100644 (file)
@@ -626,7 +626,7 @@ void action_header_buttons(const bContext *C, ARegion *ar)
        }
 
        /* always as last  */
-       UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
+       UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin));
        
        uiEndBlock(C, block);
        uiDrawBlock(C, block);
index 7cb1912f3215c6e555137226d8b24872c2ff4db0..231f53a6171227383b200530ceb585afdc4eb9dd 100644 (file)
@@ -549,8 +549,8 @@ static void markers_selectkeys_between (bAnimContext *ac)
        
        /* get extreme markers */
        //get_minmax_markers(1, &min, &max); // FIXME... add back markers api!
-       min= ac->scene->r.sfra; // xxx temp code
-       max= ac->scene->r.efra; // xxx temp code
+       min= (float)ac->scene->r.sfra; // xxx temp code
+       max= (float)ac->scene->r.efra; // xxx temp code
        
        if (min==max) return;
        min -= 0.5f;
index 8a301378fd70808b99ab883ac722ef4ae21f8b00..1c7dadcb296d0715274d84403146c5e56d8575db 100644 (file)
@@ -96,7 +96,7 @@ static SpaceLink *ipo_new(const bContext *C)
        
        ar->v2d.tot.xmin= 0.0f;
        ar->v2d.tot.ymin= -10.0f;
-       ar->v2d.tot.xmax= scene->r.efra;
+       ar->v2d.tot.xmax= (float)scene->r.efra;
        ar->v2d.tot.ymax= 10.0f;
        
        ar->v2d.cur= ar->v2d.tot;