2.5 - Silencing more MSVC warnings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user