Compiler warning fixes for mingw:
authorJoshua Leung <aligorith@gmail.com>
Tue, 27 Oct 2009 09:38:15 +0000 (09:38 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 27 Oct 2009 09:38:15 +0000 (09:38 +0000)
* There's an unresolved error in transform_conversions.c which I've flagged in this commit. I'm not quite sure what the exact intentions of that code were (i.e. was the "void_pointer = 1" really intended)

source/blender/blenfont/intern/blf.c
source/blender/blenkernel/intern/anim.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/transform/transform_conversions.c

index db88d84d0b508ddcaaee71cc745c1fe9c961b316..99ba3d50821ee82230d367bde4cb066b1eb8b483 100644 (file)
@@ -289,7 +289,7 @@ void BLF_blur(int size)
 void BLF_draw_default(float x, float y, float z, char *str)
 {
        FontBLF *font;
-       int old_font, old_point, old_dpi;
+       int old_font=0, old_point=0, old_dpi=0;
 
        if (!str)
                return;
@@ -404,7 +404,7 @@ float BLF_width_default(char *str)
 {
        FontBLF *font;
        float width;
-       int old_font, old_point, old_dpi;
+       int old_font=0, old_point=0, old_dpi=0;
 
        if (global_font_default == -1)
                global_font_default= blf_search("default");
@@ -447,7 +447,7 @@ float BLF_height_default(char *str)
 {
        FontBLF *font;
        float height;
-       int old_font, old_point, old_dpi;
+       int old_font=0, old_point=0, old_dpi=0;
 
        if (global_font_default == -1)
                global_font_default= blf_search("default");
index f119f52a47d9d89091637429238bda26f4b116de..5cae2418e89fd33ad90dd5c7a95d19c93b0d1dd0 100644 (file)
@@ -278,7 +278,7 @@ int where_on_path(Object *ob, float ctime, float *vec, float *dir, float *quat,
        /* Need to verify the quat interpolation is correct - XXX */
 
        if (quat) {
-               float totfac, q1[4], q2[4];
+               //float totfac, q1[4], q2[4];
 
                /* checks for totfac are needed when 'fac' is 1.0 key_curve_position_weights can assign zero
                 * to more then one index in data which can give divide by zero error */
index 4ddfde5e2bb2f053fea2f95721820e67d8b5d11b..d29488523469600baf4c92112e1ba9ef4d85ef4f 100644 (file)
@@ -145,6 +145,7 @@ void ui_but_anim_autokey(uiBut *but, Scene *scene, float cfra)
        if(fcu && !driven) {
                id= but->rnapoin.id.data;
                
+               // TODO: this should probably respect the keyingset only option for anim
                if(autokeyframe_cfra_can_key(scene, id)) {
                        short flag = 0;
                        
@@ -232,91 +233,3 @@ void ui_but_anim_remove_keyingset(bContext *C)
        /* this operator calls uiAnimContextProperty above */
        WM_operator_name_call(C, "ANIM_OT_remove_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL);
 }
-
-void ui_but_anim_menu(bContext *C, uiBut *but)
-{
-       uiPopupMenu *pup;
-       uiLayout *layout;
-       int length;
-
-       if(but->rnapoin.data && but->rnaprop) {
-
-               length= RNA_property_array_length(&but->rnapoin, but->rnaprop);
-
-               if(but->flag & UI_BUT_ANIMATED_KEY) {
-                       if(length) {
-                               uiItemBooleanO(layout, "Replace Keyframes", 0, "ANIM_OT_insert_keyframe_button", "all", 1);
-                               uiItemBooleanO(layout, "Replace Single Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
-                               uiItemBooleanO(layout, "Delete Keyframes", 0, "ANIM_OT_delete_keyframe_button", "all", 1);
-                               uiItemBooleanO(layout, "Delete Single Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0);
-                       }
-                       else {
-                               uiItemBooleanO(layout, "Replace Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
-                               uiItemBooleanO(layout, "Delete Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0);
-                       }
-               }
-               else if(but->flag & UI_BUT_DRIVEN);
-               else if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) {
-                       if(length) {
-                               uiItemBooleanO(layout, "Insert Keyframes", 0, "ANIM_OT_insert_keyframe_button", "all", 1);
-                               uiItemBooleanO(layout, "Insert Single Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
-                       }
-                       else
-                               uiItemBooleanO(layout, "Insert Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
-               }
-
-               if(but->flag & UI_BUT_DRIVEN) {
-                       uiItemS(layout);
-
-                       if(length) {
-                               uiItemBooleanO(layout, "Delete Drivers", 0, "ANIM_OT_remove_driver_button", "all", 1);
-                               uiItemBooleanO(layout, "Delete Single Driver", 0, "ANIM_OT_remove_driver_button", "all", 0);
-                       }
-                       else
-                               uiItemBooleanO(layout, "Delete Driver", 0, "ANIM_OT_remove_driver_button", "all", 0);
-
-                       uiItemO(layout, "Copy Driver", 0, "ANIM_OT_copy_driver_button");
-                       if (ANIM_driver_can_paste())
-                               uiItemO(layout, "Paste Driver", 0, "ANIM_OT_paste_driver_button");
-               }
-               else if(but->flag & UI_BUT_ANIMATED_KEY);
-               else if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) {
-                       uiItemS(layout);
-
-                       if(length) {
-                               uiItemBooleanO(layout, "Add Drivers", 0, "ANIM_OT_add_driver_button", "all", 1);
-                               uiItemBooleanO(layout, "Add Single Driver", 0, "ANIM_OT_add_driver_button", "all", 0);
-                       }
-                       else
-                               uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0);
-
-                       if (ANIM_driver_can_paste())
-                               uiItemO(layout, "Paste Driver", 0, "ANIM_OT_paste_driver_button");
-               }
-
-               if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) {
-                       uiItemS(layout);
-
-                       if(length) {
-                               uiItemBooleanO(layout, "Add All to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 1);
-                               uiItemBooleanO(layout, "Add Single to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0);
-                               uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button");
-                       }
-                       else {
-                               uiItemBooleanO(layout, "Add to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0);
-                               uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button");
-                       }
-               }
-
-               uiItemS(layout);
-
-               uiItemO(layout, "Copy Data Path", 0, "ANIM_OT_copy_clipboard_button");
-
-               uiItemS(layout);
-
-               //ui_but_doc_menu(layout, &but->rnapoin, but->rnaprop);
-
-               uiPupMenuEnd(C, pup);
-       }
-}
-
index 3386a2e3bdafa3d809d90e40aa2d79993d554391..5cdf3b9dcc8ad28bedfa78f951bf8d6eed4bd53d 100644 (file)
@@ -3391,7 +3391,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
 
 
        if(but->rnaprop)
-               name= RNA_property_ui_name(but->rnaprop);
+               name= (char*)RNA_property_ui_name(but->rnaprop);
        else if (but->optype)
                name= but->optype->name;
        else
index 9511f367930a43597450d096336844bb58630a0c..3d2f64b9c9155ff25c16cfa38a8a9a201bd6c403 100644 (file)
@@ -724,7 +724,6 @@ void OBJECT_OT_parent_set(wmOperatorType *ot)
 
 static int parent_noinv_set_exec(bContext *C, wmOperator *op)
 {
-       Scene *scene= CTX_data_scene(C);
        Object *par= CTX_data_active_object(C);
        
        par->recalc |= OB_RECALC_OB;
index 5d76990b0e90555c08876895a0ebf32a3ae55cb9..aa60679321a42555cd7216692e5f59093b5aefad 100644 (file)
@@ -588,7 +588,7 @@ static void vgroup_normalize(Object *ob)
        dg = BLI_findlink(&ob->defbase, (ob->actdef-1));
 
        if(dg) {
-               float weight_max;
+               float weight_max = 0.0f;
 
                def_nr= ob->actdef-1;
 
@@ -606,7 +606,7 @@ static void vgroup_normalize(Object *ob)
                                dw = ED_vgroup_weight_get(dvert, def_nr);
                                if(dw) {
                                        dw->weight /= weight_max;
-
+                                       
                                        /* incase of division errors with very low weights */
                                        CLAMP(dw->weight, 0.0f, 1.0f);
                                }
index 8100bf3899566528b05c6dd4ba90a28deb23a100..a503aefe751f0566bb3e04f5f90c53b461d86296 100644 (file)
@@ -666,7 +666,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                return 1;
        }
        else if(CTX_data_equals(member, "particle_system_editable")) {
-               if(PE_poll(C))
+               if(PE_poll((bContext*)C))
                        set_pointer_type(path, result, &RNA_ParticleSystem);
                else
                        CTX_data_pointer_set(result, NULL, &RNA_ParticleSystem, NULL);
index 077e39d6a2b34327754d7f4e570ec7242a4f974d..06a7461618c087efaee022671464b1f5b83353f6 100644 (file)
@@ -4092,7 +4092,7 @@ static void freeSeqData(TransInfo *t)
                                        for(a=0; a<t->total; a++, td++) {
                                                seq= ((TransDataSeq *)td->extra)->seq;
                                                if ((seq != seq_prev)) {
-                                                       seq->tmp= 1;
+                                                       seq->tmp= 1; // XXX what's the intention here? this currently gives a compiler warning
                                                }
                                        }