diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-28 06:34:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-28 06:34:55 +0400 |
commit | ac1cb5ee055840ba3481b8ad490e3be2a6a49cf2 (patch) | |
tree | a24cd7905f6ab5e90d2926b822f9753598198e8f /source/blender/makesrna/intern | |
parent | cf40220e54e32cf52931e461b928f26571fc2f4f (diff) |
- quiet new warnings with gcc 4.6
- use BLI math funcs for normal float/short conversion.
- correct some un-intentional float/double promotions.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_key.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_lamp.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nla.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 8 |
6 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index a7317d18df1..ded89e8b66b 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -104,7 +104,7 @@ static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max) } /* epsilon for how close one end of shapekey range can get to the other */ -#define SHAPEKEY_SLIDER_TOL 0.001 +#define SHAPEKEY_SLIDER_TOL 0.001f static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max) { diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 5f274a09f5d..c689c4ae90a 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -138,13 +138,13 @@ static void rna_Lamp_sky_update(Main *bmain, Scene *scene, PointerRNA *ptr) static float rna_Lamp_spot_size_get(PointerRNA *ptr) { Lamp *la= ptr->id.data; - return la->spotsize * (M_PI / 180.0); + return DEG2RADF(la->spotsize); } static void rna_Lamp_spot_size_set(PointerRNA *ptr, float value) { Lamp *la= ptr->id.data; - la->spotsize= value * (180.0 / M_PI); + la->spotsize= RAD2DEGF(value); } @@ -649,7 +649,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); // RNA_def_property_float_sdna(prop, NULL, "spotsize"); - RNA_def_property_range(prop, M_PI/180.0f, M_PI); + RNA_def_property_range(prop, M_PI/180.0, M_PI); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam in degrees"); RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL); /* only for deg/rad conversion */ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index a921bbbafad..719cc6755d6 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -163,7 +163,7 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) len= data->end - data->start; actlen= data->actend - data->actstart; - if (IS_EQ(actlen, 0.0f)) actlen= 1.0f; + if (IS_EQF(actlen, 0.0f)) actlen= 1.0f; /* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */ data->scale= len / ((actlen) * data->repeat); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 1531b6a9dc0..c22809c6b22 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -505,7 +505,7 @@ static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, floa if(settings->type==PART_HAIR) { *min = 0.0f; - *max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0; + *max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0f; } else { *min = (settings->draw & PART_ABS_PATH_TIME) ? settings->sta : 0.0f; diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index ca3852c0fd0..10c784b51e7 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -734,12 +734,12 @@ static int rna_enum_check_separator(CollectionPropertyIterator *iter, void *data static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; - EnumPropertyRNA *eprop; + // EnumPropertyRNA *eprop; // UNUSED EnumPropertyItem *item= NULL; int totitem, free= 0; rna_idproperty_check(&prop, ptr); - eprop= (EnumPropertyRNA*)prop; + // eprop= (EnumPropertyRNA*)prop; RNA_property_enum_items(NULL, ptr, prop, &item, &totitem, &free); rna_iterator_array_begin(iter, (void*)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 0d1463428bb..ea26663df44 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -918,8 +918,8 @@ static StructRNA *rna_Operator_register(bContext *C, ReportList *reports, void * int idlen = strlen(_operator_idname) + 4; int namelen = strlen(_operator_name) + 1; int desclen = strlen(_operator_descr) + 1; - char *ch, *ch_arr; - ch_arr= ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */ + char *ch; + ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */ WM_operator_bl_idname(ch, _operator_idname); /* convert the idname from python */ dummyot.idname= ch; ch += idlen; @@ -985,8 +985,8 @@ static StructRNA *rna_MacroOperator_register(bContext *C, ReportList *reports, v int idlen = strlen(_operator_idname) + 4; int namelen = strlen(_operator_name) + 1; int desclen = strlen(_operator_descr) + 1; - char *ch, *ch_arr; - ch_arr= ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */ + char *ch; + ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */ WM_operator_bl_idname(ch, _operator_idname); /* convert the idname from python */ dummyot.idname= ch; ch += idlen; |