2.5 - Silencing various compiler warnings (mingw)
authorJoshua Leung <aligorith@gmail.com>
Thu, 16 Jul 2009 04:45:52 +0000 (04:45 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 16 Jul 2009 04:45:52 +0000 (04:45 +0000)
22 files changed:
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/keyframes_general.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/ed_fluidsim.c
source/blender/editors/physics/editparticle.c
source/blender/editors/preview/previewrender.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_outliner/outliner_ops.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_particle.c
source/blender/windowmanager/intern/wm_subwindow.c

index 5489c55..1d7ba88 100644 (file)
@@ -4858,7 +4858,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
                        }
                        else if(sl->spacetype==SPACE_CONSOLE) {
                                SpaceConsole *sconsole= (SpaceConsole *)sl;
-                               ConsoleLine *cl;
+                               //ConsoleLine *cl;
                                
                                link_list(fd, &sconsole->scrollback);
                                link_list(fd, &sconsole->history);
index 6e62b16..fc67ee3 100644 (file)
@@ -43,6 +43,8 @@
 #include "DNA_space_types.h"
 #include "DNA_scene_types.h"
 
+#include "RNA_access.h"
+
 #include "BKE_action.h"
 #include "BKE_fcurve.h"
 #include "BKE_key.h"
@@ -52,8 +54,6 @@
 #include "ED_keyframing.h"
 #include "ED_keyframes_edit.h"
 
-#include "RNA_access.h"
-
 /* This file contains code for various keyframe-editing tools which are 'destructive'
  * (i.e. they will modify the order of the keyframes, and change the size of the array).
  * While some of these tools may eventually be moved out into blenkernel, for now, it is
index 6f5692d..a1ce256 100644 (file)
@@ -2139,15 +2139,15 @@ static MemoNode * solveJoints(MemoNode *table, BArcIterator *iter, float **vec_c
                MemoNode *min_node = NULL;
                float *vec0 = vec_cache[previous];
                float *vec1 = vec_cache[current];
-               float min_weight;
-               int min_next;
+               float min_weight= 0.0f;
+               int min_next= 0;
                int next;
                
                for (next = current + 1; next <= nb_positions - (joints_left - 1); next++)
                {
                        MemoNode *next_node;
                        float *vec2 = vec_cache[next];
-                       float weight = 0;
+                       float weight = 0.0f;
                        
                        /* ADD WEIGHT OF PREVIOUS - CURRENT - NEXT triple */
                        weight = calcCostAngleLengthDistance(iter, vec_cache, edge, vec0, vec1, vec2, current, next, angle_weight, length_weight, distance_weight);
@@ -2824,7 +2824,7 @@ void BIF_retargetArmature(bContext *C)
        ReebGraph *reebg;
        double start_time, end_time;
        double gstart_time, gend_time;
-       double reeb_time, rig_time, retarget_time, total_time;
+       double reeb_time, rig_time=0.0, retarget_time=0.0, total_time;
        
        gstart_time = start_time = PIL_check_seconds_timer();
        
index c0c1cbc..ef4e092 100644 (file)
@@ -322,7 +322,7 @@ static void gp_strokepoint_convertcoords (bGPDstroke *gps, bGPDspoint *pt, float
        }
        else {
                short mval[2];
-               int mx, my;
+               int mx=0, my=0;
                float *fp= give_cursor(NULL, NULL); // XXX should be scene, v3d
                float dvec[3];
                
index eb79848..4df8641 100644 (file)
@@ -170,6 +170,8 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int
                        uiItemL(uiLayoutColumn(split, 0), name, 0);
                        col= uiLayoutColumn(split, 0);
                }
+               else
+                       col= NULL;
 
                /* temp hack to show normal button for spin/screw */
                if(strcmp(name, "Axis")==0) {
index 8f40b2e..afb7e74 100644 (file)
@@ -1438,7 +1438,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect)
 {
        int a;
        float h,s,v;
-       float dx, dy, sx1, sx2, sy, x, y;
+       float dx, dy, sx1, sx2, sy, x=0.0f, y=0.0f;
        float col0[4][3];       // left half, rect bottom to top
        float col1[4][3];       // right half, rect bottom to top
        
index fb71fc0..3d3e29b 100644 (file)
@@ -230,8 +230,8 @@ void duplicate_defgroup ( Object *ob )
        bDeformGroup *dg, *cdg;
        char name[32], s[32];
        MDeformWeight *org, *cpy;
-       MDeformVert *dvert, *dvert_array;
-       int i, idg, icdg, dvert_tot;
+       MDeformVert *dvert, *dvert_array=NULL;
+       int i, idg, icdg, dvert_tot=0;
 
        if (ob->type != OB_MESH && ob->type != OB_LATTICE)
                return;
@@ -353,9 +353,8 @@ static void del_defgroup_update_users(Object *ob, int id)
 void del_defgroup_in_object_mode ( Object *ob )
 {
        bDeformGroup *dg;
-       MDeformVert *dvert_array, *dvert;
-       
-       int i, e, dvert_tot;
+       MDeformVert *dvert, *dvert_array=NULL;
+       int i, e, dvert_tot=0;
 
        if ((!ob) || (ob->type != OB_MESH && ob->type != OB_LATTICE))
                return;
index 3990521..a8862eb 100644 (file)
@@ -93,6 +93,9 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+/* enable/disable overall compilation */
+#ifndef DISABLE_ELBEEM
+
 /* XXX */
 /* from header info.c */
 static int start_progress_bar(void) {return 0;};
@@ -121,10 +124,6 @@ char* fluidsimViscosityPresetString[6] = {
        "INVALID"       /* end */
 };
 
-/* enable/disable overall compilation */
-#ifndef DISABLE_ELBEEM
-
-
 /* ********************** fluid sim settings struct functions ********************** */
 
 /* helper function */
index 3f7880b..f414297 100644 (file)
@@ -2282,7 +2282,7 @@ static int brush_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *eve
        ParticleEditSettings *pset= PE_settings(CTX_data_scene(C));
        ParticleBrushData *brush;
        int mode = RNA_enum_get(op->ptr, "mode");
-       float original_value;
+       float original_value=1.0f;
 
        if(pset->brushtype < 0)
                return OPERATOR_CANCELLED;
@@ -3570,7 +3570,7 @@ void PE_undo_menu(Scene *scene, Object *ob)
        ParticleEdit *edit= 0;
        ParticleUndo *undo;
        DynStr *ds;
-       short event;
+       short event=0;
        char *menu;
 
        if(!PE_can_edit(psys)) return;
index 1efa510..e79dbed 100644 (file)
@@ -453,7 +453,7 @@ void view3d_previewrender_progress(RenderResult *rr, volatile rcti *renrect)
 //     ScrArea *sa= NULL; // XXX
 //     View3D *v3d= NULL; // XXX
        RenderLayer *rl;
-       int ofsx, ofsy;
+       int ofsx=0, ofsy=0;
        
        if(renrect) return;
        
@@ -576,7 +576,7 @@ void BIF_view3d_previewrender(Scene *scene, ScrArea *sa)
        View3D *v3d= sa->spacedata.first;
        RegionView3D *rv3d= NULL; // XXX
        Render *re;
-       RenderInfo *ri; /* preview struct! */
+       RenderInfo *ri=NULL;    /* preview struct! */
        RenderStats *rstats;
        RenderData rdata;
        rctf viewplane;
index 113e724..07aaf0f 100644 (file)
@@ -2337,6 +2337,7 @@ static ScrArea *find_area_image_empty(bContext *C)
        return sa;
 }
 
+#if 0 // XXX not used
 static ScrArea *find_empty_image_area(bContext *C)
 {
        bScreen *sc= CTX_wm_screen(C);
@@ -2353,6 +2354,7 @@ static ScrArea *find_empty_image_area(bContext *C)
        }
        return sa;
 }
+#endif // XXX not used
 
 static void screen_set_image_output(bContext *C)
 {
index 720e64d..b190b76 100644 (file)
@@ -2763,7 +2763,7 @@ static void project_bucket_bounds(const ProjPaintState *ps, const int bucket_x,
 static void project_bucket_init(const ProjPaintState *ps, const int thread_index, const int bucket_index, rctf *bucket_bounds)
 {
        LinkNode *node;
-       int face_index, image_index;
+       int face_index, image_index=0;
        ImBuf *ibuf = NULL;
        MTFace *tf;
        
@@ -2820,7 +2820,7 @@ static int project_bucket_face_isect(ProjPaintState *ps, float min[2], float max
        /* TODO - replace this with a tricker method that uses sideofline for all screenCoords's edges against the closest bucket corner */
        rctf bucket_bounds;
        float p1[2], p2[2], p3[2], p4[2];
-       float *v, *v1,*v2,*v3,*v4;
+       float *v, *v1,*v2,*v3,*v4=NULL;
        int fidx;
        
        project_bucket_bounds(ps, bucket_x, bucket_y, &bucket_bounds);
@@ -3194,7 +3194,7 @@ static void project_paint_begin(ProjPaintState *ps)
                
                if (tf->tpage && ((G.f & G_FACESELECT)==0 || mf->flag & ME_FACE_SEL)) {
                        
-                       float *v1coSS, *v2coSS, *v3coSS, *v4coSS;
+                       float *v1coSS, *v2coSS, *v3coSS, *v4coSS=NULL;
                        
                        v1coSS = ps->screenCoords[mf->v1]; 
                        v2coSS = ps->screenCoords[mf->v2]; 
@@ -3339,7 +3339,7 @@ static void project_paint_end(ProjPaintState *ps)
                /* context */
                ProjPaintImage *last_projIma;
                int last_image_index = -1;
-               int last_tile_width;
+               int last_tile_width=0;
                
                for(a=0, last_projIma=ps->projImages; a < ps->image_tot; a++, last_projIma++) {
                        int size = sizeof(UndoTile **) * IMAPAINT_TILE_NUMBER(last_projIma->ibuf->x) * IMAPAINT_TILE_NUMBER(last_projIma->ibuf->y);
@@ -3703,7 +3703,7 @@ static void *do_projectpaint_thread(void *ph_v)
        ProjPixel *projPixel;
        
        int last_index = -1;
-       ProjPaintImage *last_projIma;
+       ProjPaintImage *last_projIma= NULL;
        ImagePaintPartialRedraw *last_partial_redraw_cell;
        
        float rgba[4], alpha, dist_nosqrt;
index 30712ea..72f9789 100644 (file)
@@ -148,7 +148,7 @@ int ED_fileselect_layout_offset(FileLayout* layout, int x, int y)
        int active_file;
 
        if (layout == NULL)
-               return NULL;
+               return 0;
        
        offsetx = (x)/(layout->tile_w + 2*layout->tile_border_x);
        offsety = (y)/(layout->tile_h + 2*layout->tile_border_y);
@@ -351,7 +351,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *arg_v)
 
                for(i= 0; i<nentries; ++i) {
                        struct direntry* file = filelist_file(sfile->files, i);
-                       char* dir = filelist_dir(sfile->files);
+                       const char* dir = filelist_dir(sfile->files);
                        if (file && S_ISDIR(file->type))        {
                                BLI_make_file_string(G.sce, tmp, dir, file->relname);
                                autocomplete_do_name(autocpl,tmp);
@@ -362,4 +362,4 @@ void autocomplete_directory(struct bContext *C, char *str, void *arg_v)
                        BLI_add_slash(str);
                }
        }
-}
\ No newline at end of file
+}
index 36ee64f..6fddd16 100644 (file)
 
 #include "WM_api.h"
 #include "WM_types.h"
+
+#include "RNA_access.h"
 #include "RNA_define.h"
+
 #include "ED_screen.h"
 
 #include "outliner_intern.h"
index 93c6c53..41da2c5 100644 (file)
@@ -2974,9 +2974,9 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
        float vec[3], vec2[3];
        float *vd = pdd->vd;
        float *cd = pdd->cd;
-       float ma_r;
-       float ma_g;
-       float ma_b;
+       float ma_r=0.0f;
+       float ma_g=0.0f;
+       float ma_b=0.0f;
 
        if(pdd->ma_r) {
                ma_r = *pdd->ma_r;
index fba263f..3cf438b 100644 (file)
@@ -949,6 +949,7 @@ void selectTransformOrientation_func(bContext *C, void *target, void *unused)
        BIF_selectTransformOrientation(C, (TransformOrientation *) target);
 }
 
+#if 0 // XXX not used
 static void view3d_panel_transform_spaces(const bContext *C, Panel *pa)
 {
        Scene *scene= CTX_data_scene(C);
@@ -999,6 +1000,7 @@ static void view3d_panel_transform_spaces(const bContext *C, Panel *pa)
        }
        uiBlockEndAlign(block);
 }
+#endif // XXX not used
 
 static void weight_paint_buttons(Scene *scene, uiBlock *block)
 {
@@ -1369,6 +1371,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
        }
 }
 
+#if 0 // XXX not used anymore
 static void view3d_panel_background(const bContext *C, Panel *pa)
 {
        View3D *v3d= CTX_wm_view3d(C);
@@ -1493,6 +1496,7 @@ static void view3d_panel_properties(const bContext *C, Panel *pa)
 //     }
        uiBlockEndAlign(block); 
 }
+#endif // XXX not used anymore
 
 #if 0
 static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl)        // VIEW3D_HANDLER_PREVIEW
@@ -1547,6 +1551,7 @@ static void view3d_panel_gpencil(const bContext *C, Panel *pa)
 }
 #endif
 
+#if 0 // XXX not used
 static void delete_sketch_armature(bContext *C, void *arg1, void *arg2)
 {
        BIF_deleteSketch(C);
@@ -1727,6 +1732,7 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
        RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
        uiDefAutoButsRNA(C, pa->layout, &ptr, 2);
 }
+#endif // XXX not used
 
 void view3d_buttons_register(ARegionType *art)
 {
index b57f4a9..cb20b3d 100644 (file)
@@ -1383,6 +1383,8 @@ void VIEW3D_OT_localview(wmOperatorType *ot)
        ot->poll= ED_operator_view3d_active;
 }
 
+#if GAMEBLENDER == 1
+
 static ListBase queue_back;
 static void SaveState(bContext *C)
 {
@@ -1425,12 +1427,12 @@ static void RestoreState(bContext *C)
 /* maybe we need this defined somewhere else */
 extern void StartKetsjiShell(struct bContext *C,int always_use_expand_framing);
 
+#endif // GAMEBLENDER == 1
 
 static int game_engine_exec(bContext *C, wmOperator *unused)
 {
-       Scene *startscene = CTX_data_scene(C);
-       
 #if GAMEBLENDER == 1
+       Scene *startscene = CTX_data_scene(C);
        
        view3d_operator_needs_opengl(C);
        
index d1394d6..62b6858 100644 (file)
@@ -64,6 +64,7 @@
 //#include "BIF_editparticle.h"
 //#include "BIF_meshtools.h"
 
+#include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_anim.h"
 #include "BKE_armature.h"
@@ -305,7 +306,6 @@ void recalcData(TransInfo *t)
                flushTransSeq(t);
        }
        else if (t->spacetype == SPACE_ACTION) {
-               SpaceAction *sact= (SpaceAction *)t->sa->spacedata.first;
                Scene *scene;
                
                bAnimContext ac;
@@ -340,7 +340,6 @@ void recalcData(TransInfo *t)
                BLI_freelistN(&anim_data);
        }
        else if (t->spacetype == SPACE_IPO) {
-               SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
                Scene *scene;
                
                ListBase anim_data = {NULL, NULL};
@@ -374,7 +373,6 @@ void recalcData(TransInfo *t)
                /* now test if there is a need to re-sort */
                for (ale= anim_data.first; ale; ale= ale->next) {
                        FCurve *fcu= (FCurve *)ale->key_data;
-                       AnimData *adt= BKE_animdata_from_id(ale->id);
                        
                        /* watch it: if the time is wrong: do not correct handles yet */
                        if (test_time_fcurve(fcu))
index c656b09..ef92787 100644 (file)
@@ -340,7 +340,6 @@ int calc_manipulator_stats(const bContext *C)
                }
        }
        else if(ob && (ob->flag & OB_POSEMODE)) {
-               bArmature *arm = ob->data;
                bPoseChannel *pchan;
                int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed
 
index e504d1d..8385925 100644 (file)
@@ -1620,7 +1620,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
        StructRNA *ptype;
        PointerRNA itemptr;
        PropertyRNA *itemprop, *iprop;
-       PropertyType itemtype;
+       PropertyType itemtype=0;
        RawArray in;
        int itemlen= 0;
 
index ef68e0b..3c25bd7 100644 (file)
@@ -411,14 +411,14 @@ static void rna_KeyedParticleTarget_name_get(PointerRNA *ptr, char *str)
                strcpy(str, "Invalid target!");
 }
 
-static EnumPropertyItem from_items[] = {
+EnumPropertyItem from_items[] = {
        {PART_FROM_VERT, "VERT", 0, "Vertexes", ""},
        {PART_FROM_FACE, "FACE", 0, "Faces", ""},
        {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
        {0, NULL, 0, NULL, NULL}
 };
 
-static EnumPropertyItem reactor_from_items[] = {
+EnumPropertyItem reactor_from_items[] = {
        {PART_FROM_VERT, "VERT", 0, "Vertexes", ""},
        {PART_FROM_FACE, "FACE", 0, "Faces", ""},
        {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
index 835fdca..dc2aca7 100644 (file)
@@ -523,6 +523,7 @@ int WM_framebuffer_to_index(unsigned int col)
 
 /* ********** END MY WINDOW ************** */
 
+#if 0 // XXX not used...
 #ifdef WIN32
 static int is_a_really_crappy_nvidia_card(void) {
        static int well_is_it= -1;
@@ -534,4 +535,5 @@ static int is_a_really_crappy_nvidia_card(void) {
        return well_is_it;
 }
 #endif
+#endif // XXX not used...