remove/comment unused vars
authorCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jan 2011 04:53:55 +0000 (04:53 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jan 2011 04:53:55 +0000 (04:53 +0000)
also removed unnecessary NULL checks (where the pointer was used later without checking).

40 files changed:
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/multires.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/poseobject.c
source/blender/editors/armature/reeb.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_add.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_shading.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/intern/gpu_draw.c
source/blender/imbuf/intern/tiff.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_meta.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/python/intern/bpy_rna_array.c
source/blender/windowmanager/intern/wm_event_system.c

index 8cac3860e795b985d88eafbee7d10f4db863112e..68a949ed25aa0a64497ba6ca9b5dd8b0d66f4d98 100644 (file)
@@ -1172,7 +1172,6 @@ static void new_particle_duplilist(ListBase *lb, ID *UNUSED(id), Scene *scene, O
        float (*obmat)[4], (*oldobmat)[4];
        int a, b, counter, hair = 0;
        int totpart, totchild, totgroup=0, pa_num;
-       unsigned int lay;
 
        if(psys==0) return;
        
@@ -1193,8 +1192,7 @@ static void new_particle_duplilist(ListBase *lb, ID *UNUSED(id), Scene *scene, O
        totchild = psys->totchild;
 
        BLI_srandom(31415926 + psys->seed);
-       
-       lay= scene->lay;
+
        if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
                ParticleSimulationData sim= {0};
                sim.scene= scene;
index e7dff52db62c3357ed00537dd0e6774c5a3214b8..8cdfd60b9a778d747eff403d69faf620c58a13e1 100644 (file)
@@ -1457,13 +1457,13 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
 static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair *collisions, CollPair *collisions_index)
 {
        Cloth *cloth = clmd->clothObject;
-       int i=0, j = 0, numfaces = 0, numverts = 0;
+       int i=0, j = 0, /*numfaces = 0,*/ numverts = 0;
        ClothVertex *verts = NULL;
        int ret = 0;
        int result = 0;
        float tnull[3] = {0,0,0};
        
-       numfaces = clmd->clothObject->numfaces;
+       /*numfaces = clmd->clothObject->numfaces;*/ /*UNUSED*/
        numverts = clmd->clothObject->numverts;
  
        verts = cloth->verts;
index 57f66a3734348924976d02c0cbfb6aa14990ca8c..94bb771aecdfa7eca131ccd2ae83ab035cbff551 100644 (file)
@@ -893,13 +893,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
 void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
                                          CustomDataMask mask, int alloctype, int totelem)
 {
-       const LayerTypeInfo *typeInfo;
+       /*const LayerTypeInfo *typeInfo;*/
        CustomDataLayer *layer, *newlayer;
        int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0, lastflag = 0;
 
        for(i = 0; i < source->totlayer; ++i) {
                layer = &source->layers[i];
-               typeInfo = layerType_getInfo(layer->type);
+               /*typeInfo = layerType_getInfo(layer->type);*/ /*UNUSED*/
 
                type = layer->type;
 
index ed0b1bfcecab0e67b3ed7ee7079856f4d505ae32..0fb19685f25a39cf983e70b485c1b65d53fb990d 100644 (file)
@@ -707,7 +707,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int
        MFace *mface = me->mface;
        MDisps *mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS);
        int *gridOffset;
-       int i, numGrids, gridSize, dGridSize, dSkip;
+       int i, /*numGrids,*/ gridSize, dGridSize, dSkip;
 
        if(!mdisps) {
                if(invert)
@@ -716,7 +716,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int
                        return;
        }
 
-       numGrids = dm->getNumGrids(dm);
+       /*numGrids = dm->getNumGrids(dm);*/ /*UNUSED*/
        gridSize = dm->getGridSize(dm);
        gridData = dm->getGridData(dm);
        gridOffset = dm->getGridOffset(dm);
index f62fb83deca04b8411e5a95a4c6686d8daffd74c..2252c926c7150b0bfa00a1f6b761736e456d71a8 100644 (file)
@@ -1209,12 +1209,10 @@ static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op))
        Object *obedit= CTX_data_edit_object(C);
        Object *oldob, *newob;
        Base *oldbase, *newbase;
-       bArmature *arm;
        
        /* sanity checks */
        if (obedit == NULL)
                return OPERATOR_CANCELLED;
-       arm= obedit->data;
        
        /* set wait cursor in case this takes a while */
        WM_cursor_wait(1);
index d4f25c10e30df27949263ab18b4d99585a3b499c..cabf81ea85e6c3f7488d528384f4a32be4647811 100644 (file)
@@ -2730,8 +2730,6 @@ static void retargetGraphs(bContext *C, RigGraph *rigg)
        BIF_flagMultiArcs(reebg, ARC_FREE);
        
        /* return to first level */
-       reebg = rigg->link_mesh;
-       
        inode = rigg->head;
        
        matchMultiResolutionStartingNode(rigg, reebg, inode);
@@ -2887,7 +2885,6 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg)
        Object *ob;
        RigGraph *rigg;
        RigArc *iarc;
-       bArmature *arm;
        char *side_string = scene->toolsettings->skgen_side_string;
        char *num_string = scene->toolsettings->skgen_num_string;
        int free_template = 0;
@@ -2895,14 +2892,12 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg)
        if (template_rigg)
        {
                ob = template_rigg->ob;         
-               arm = ob->data;
        }
        else
        {
                free_template = 1;
-               ob = obedit;    
-               arm = ob->data;
-               template_rigg = armatureSelectedToGraph(C, ob, arm);
+               ob = obedit;
+               template_rigg = armatureSelectedToGraph(C, ob, ob->data);
        }
        
        if (template_rigg->arcs.first == NULL)
index cae6491378eff9da4b98ecc79b303245d9cba242..6c1adcb2ccb2e7eeaa03825e35ffab9050c5c573 100644 (file)
@@ -667,7 +667,7 @@ void pose_copy_menu(Scene *scene)
 {
        Object *obedit= scene->obedit; // XXX context
        Object *ob= OBACT;
-       bArmature *arm= ob->data;
+       bArmature *arm;
        bPoseChannel *pchan, *pchanact;
        short nr=0;
        int i=0;
@@ -680,7 +680,8 @@ void pose_copy_menu(Scene *scene)
        
        if (pchan==NULL) return;
        pchanact= pchan;
-       
+       arm= ob->data;
+
        /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable, 
         * but for constraints (just add local constraints)
         */
@@ -1241,7 +1242,6 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
 {
        ScrArea *sa= CTX_wm_area(C);
        Object *ob;
-       bArmature *arm;
        bPose *pose;
        short done= 0;
        
@@ -1254,7 +1254,7 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
        /* only continue if there's an object, and a pose there too */
        if (ELEM(NULL, ob, ob->pose))
                return OPERATOR_CANCELLED;
-       arm= ob->data;
+
        pose= ob->pose;
        
        /* set the active group number to the one from operator props 
@@ -1306,8 +1306,6 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op))
 {
        ScrArea *sa= CTX_wm_area(C);
        Object *ob;
-       bArmature *arm;
-       bPose *pose;
        short done= 0;
        
        /* since this call may also be used from the buttons window, we need to check for where to get the object */
@@ -1319,8 +1317,6 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op))
        /* only continue if there's an object, and a pose there too */
        if (ELEM(NULL, ob, ob->pose))
                return OPERATOR_CANCELLED;
-       pose= ob->pose;
-       arm= ob->data;
        
        /* find selected bones to remove from all bone groups */
        CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
@@ -1561,16 +1557,17 @@ void POSE_OT_autoside_names (wmOperatorType *ot)
 void pose_activate_flipped_bone(Scene *scene)
 {
        Object *ob= OBACT;
-       bArmature *arm= ob->data;
-       
+
        if(ob==NULL) return;
 
        if(ob->mode & OB_MODE_WEIGHT_PAINT) {
                ob= modifiers_isDeformedByArmature(ob);
        }
+
        if(ob && (ob->mode & OB_MODE_POSE)) {
                bPoseChannel *pchanf;
-               
+               bArmature *arm= ob->data;
+
                if(arm->act_bone) {
                        char name[32];
                        flip_side_name(name, arm->act_bone->name, TRUE);
index 780dc8827c4a3794277ea210a50b1e36d243a633..29ba72ce604c93d2b648c428a6e908302f6a8e25 100644 (file)
@@ -2558,10 +2558,10 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
        EditVert *eve;
        EditFace *efa;
        int index;
-       int totvert;
-       int totfaces;
+       /*int totvert;*/
        
 #ifdef DEBUG_REEB
+       int totfaces;
        int countfaces = 0;
 #endif
        
@@ -2569,8 +2569,10 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
        
        rg->resolution = subdivisions;
        
-       totvert = BLI_countlist(&em->verts);
+       /*totvert = BLI_countlist(&em->verts);*/ /*UNUSED*/
+#ifdef DEBUG_REEB
        totfaces = BLI_countlist(&em->faces);
+#endif
        
        renormalizeWeight(em, 1.0f);
        
@@ -2641,7 +2643,7 @@ void renormalizeWeight(EditMesh *em, float newmax)
        eve = em->verts.first;
        minimum = weightData(eve);
        maximum = minimum;
-       for(eve = em->verts.first; eve; eve = eve->next)
+       for(; eve; eve = eve->next)
        {
                maximum = MAX2(maximum, weightData(eve));
                minimum = MIN2(minimum, weightData(eve));
index d74a907d78507d626f57170c5c4c17b9a0c36fb0..2620db30b3918ecd260c4e82bb1c7bb7f5c3b072 100644 (file)
@@ -1801,7 +1801,7 @@ static double soft_range_round_down(double value, double max)
 void ui_set_but_soft_range(uiBut *but, double value)
 {
        PropertyType type;
-       double softmin, softmax, step, precision;
+       double softmin, softmax /*, step, precision*/;
        
        if(but->rnaprop) {
                type= RNA_property_type(but->rnaprop);
@@ -1814,8 +1814,8 @@ void ui_set_but_soft_range(uiBut *but, double value)
                        RNA_property_int_ui_range(&but->rnapoin, but->rnaprop, &imin, &imax, &istep);
                        softmin= (imin == INT_MIN)? -1e4: imin;
                        softmax= (imin == INT_MAX)? 1e4: imax;
-                       step= istep;
-                       precision= 1;
+                       /*step= istep;*/ /*UNUSED*/
+                       /*precision= 1;*/ /*UNUSED*/
                }
                else if(type == PROP_FLOAT) {
                        float fmin, fmax, fstep, fprecision;
@@ -1823,8 +1823,8 @@ void ui_set_but_soft_range(uiBut *but, double value)
                        RNA_property_float_ui_range(&but->rnapoin, but->rnaprop, &fmin, &fmax, &fstep, &fprecision);
                        softmin= (fmin == -FLT_MAX)? -1e4: fmin;
                        softmax= (fmax == FLT_MAX)? 1e4: fmax;
-                       step= fstep;
-                       precision= fprecision;
+                       /*step= fstep;*/ /*UNUSED*/
+                       /*precision= fprecision;*/ /*UNUSED*/
                }
                else
                        return;
index 1f25f96821325cab8f2ee8e15391e8c502130d1a..e96740d635382c9efeb22c8c9c95239c541c8b2a 100644 (file)
@@ -1893,15 +1893,12 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
        int groups, cols, layers;
        int group, col, layer, row;
        int cols_per_group = 5;
-       const char *desc;
-       
+
        prop= RNA_struct_find_property(ptr, propname);
        if (!prop) {
                printf("uiTemplateLayer: layers property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
        }
-
-       desc= RNA_property_description(prop);
        
        /* the number of layers determines the way we group them 
         *      - we want 2 rows only (for now)
index 54a3adc5da372420de6c23b119d93c05f47df636..cdccc1e01103d37ba7192c568cf0d7849cba40f5 100644 (file)
@@ -4474,8 +4474,6 @@ static int mesh_noise_exec(bContext *C, wmOperator *op)
 
 void MESH_OT_noise(wmOperatorType *ot)
 {
-       PropertyRNA *prop;
-       
        /* identifiers */
        ot->name= "Noise";
        ot->description= "Use vertex coordinate as texture coordinate";
@@ -4488,8 +4486,7 @@ void MESH_OT_noise(wmOperatorType *ot)
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
-       prop= RNA_def_float(ot->srna, "factor", 0.1f, -FLT_MAX, FLT_MAX, "Factor", "", 0.0f, 1.0f);
-
+       RNA_def_float(ot->srna, "factor", 0.1f, -FLT_MAX, FLT_MAX, "Factor", "", 0.0f, 1.0f);
 }
 
 void flipface(EditMesh *em, EditFace *efa)
index 0fde8d7599009742d867ed1f2d52348d03f65125..3e359101f3a5f3a6f948728869432a1984f7978a 100644 (file)
@@ -5685,7 +5685,7 @@ static int collapseEdges(EditMesh *em)
        CollectedEdge *curredge;
        Collection *edgecollection;
 
-       int totedges, groupcount, mergecount,vcount;
+       int totedges, mergecount,vcount /*, groupcount*/;
        float avgcount[3];
 
        allcollections.first = 0;
@@ -5694,7 +5694,7 @@ static int collapseEdges(EditMesh *em)
        mergecount = 0;
 
        build_edgecollection(em, &allcollections);
-       groupcount = BLI_countlist(&allcollections);
+       /*groupcount = BLI_countlist(&allcollections);*/ /*UNUSED*/
 
 
        for(edgecollection = allcollections.first; edgecollection; edgecollection = edgecollection->next){
index 682010be4dbeedf0c84acbe6b4d84d43060654f5..b2cb3e06de36279377e31efd3eb77c819ddd0cee 100644 (file)
@@ -231,7 +231,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
        RNA_boolean_set(kmi->ptr, "extend", 1);
 
-       kmi= WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
        kmi= WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0);
        RNA_boolean_set(kmi->ptr, "extend", 1);
 
index 3e7b76044484e0ed2fe0151cf7a0b3c319805cdf..c4fe5f8fbc12637489a9d0975ad27e7db073ad2a 100644 (file)
@@ -92,9 +92,9 @@ int join_mesh_exec(bContext *C, wmOperator *op)
        Object *ob= CTX_data_active_object(C);
        Material **matar, *ma;
        Mesh *me;
-       MVert *mvert, *mv, *mvertmain;
-       MEdge *medge = NULL, *medgemain;
-       MFace *mface = NULL, *mfacemain;
+       MVert *mvert, *mv;
+       MEdge *medge = NULL;
+       MFace *mface = NULL;
        Key *key, *nkey=NULL;
        KeyBlock *kb, *okb, *kbn;
        float imat[4][4], cmat[4][4], *fp1, *fp2, curpos;
@@ -280,11 +280,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
        mvert= CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
        medge= CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
        mface= CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface);
-       
-       mvertmain= mvert;
-       medgemain= medge;
-       mfacemain= mface;
-       
+
        vertofs= 0;
        edgeofs= 0;
        faceofs= 0;
index e4fc8c16470ad51ba727218cf05159bc63f93774..cd2b0f79f1afebe5302f8ec2772bd7a2229567eb 100644 (file)
@@ -680,9 +680,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
 
        ob= ED_object_add_type(C, OB_LAMP, loc, rot, FALSE, layer);
-       if(ob && ob->data)
-               ((Lamp*)ob->data)->type= type;
-       
+       ((Lamp*)ob->data)->type= type;
        rename_id((ID *)ob, get_lamp_defname(type));
        rename_id((ID *)ob->data, get_lamp_defname(type));
        
index 9ce8488c4616b83ae0206a7923b2a6a46d0d03c0..0017fd0130a9600b77a4c471bbc65db747c141f1 100644 (file)
@@ -1036,10 +1036,8 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
 {
        DerivedMesh *dm=psys_get_modifier(ob,psys)->dm;
        PTCacheEdit *edit= psys->edit;
-       MFace *mface;
-       MVert *mvert;
        float *vec, *nor;
-       int i, totface, totvert;
+       int i, totface /*, totvert*/;
 
        if(!dm)
                return;
@@ -1050,7 +1048,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
        BLI_kdtree_free(edit->emitter_field);
 
        totface=dm->getNumFaces(dm);
-       totvert=dm->getNumVerts(dm);
+       /*totvert=dm->getNumVerts(dm);*/ /*UNSUED*/
 
        edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float),"emitter cosnos");
 
@@ -1059,9 +1057,9 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
        vec=edit->emitter_cosnos;
        nor=vec+3;
 
-       mvert=dm->getVertDataArray(dm,CD_MVERT);
        for(i=0; i<totface; i++, vec+=6, nor+=6) {
-               mface=dm->getFaceData(dm,i,CD_MFACE);
+               MFace *mface=dm->getFaceData(dm,i,CD_MFACE);
+               MVert *mvert;
 
                mvert=dm->getVertData(dm,mface->v1,CD_MVERT);
                VECCOPY(vec,mvert->co);
@@ -2062,12 +2060,11 @@ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror)
        POINT_P;
        PTCacheEditPoint *npoint=0, *new_points=0;
        ParticleSystemModifierData *psmd;
-       int i, totpart, new_totpart= psys->totpart, removed= 0;
+       int i, new_totpart= psys->totpart, removed= 0;
 
        if(mirror) {
                /* mirror tags */
                psmd= psys_get_modifier(ob, psys);
-               totpart= psys->totpart;
 
                LOOP_TAGGED_POINTS {
                        PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL);
index 8a4a0433eb839cb61c2d6b299869e01edd35202c..c2b2a0ad4574b6b72b73d25961d1b66dd028ac9f 100644 (file)
@@ -130,20 +130,19 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
         */
 
        if(view_context) {
-               int is_ortho;
                GPU_offscreen_bind(oglrender->ofs); /* bind */
 
                /* render 3d view */
                if(rv3d->persp==RV3D_CAMOB && v3d->camera) {
+                       /*int is_ortho= scene->r.mode & R_ORTHO;*/
                        RE_GetCameraWindow(oglrender->re, v3d->camera, scene->r.cfra, winmat);
-                       is_ortho= scene->r.mode & R_ORTHO;
                        
                }
                else {
                        rctf viewplane;
                        float clipsta, clipend;
-       
-                       is_ortho= get_view3d_viewplane(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL);
+
+                       int is_ortho= get_view3d_viewplane(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL);
                        if(is_ortho) orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
                        else  perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
                }
index 44fce4819f319394239ac1e299a502041cca2274..560819b5e0f8fcc0f21c495a9be74d3e2538154c 100644 (file)
@@ -851,6 +851,10 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int
                ibuf = IMB_allocImBuf(dx, dx, 24, IB_rectfloat);
                IMB_rectcpy(ibuf, env->cube[1], 0, 0, 0, 0, dx, dx);            
        }
+       else {
+               BKE_report(op->reports, RPT_ERROR, "Invalid environment map type");
+               return OPERATOR_CANCELLED;
+       }
        
        if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
                ibuf->profile = IB_PROFILE_LINEAR_RGB;
index 9e29967a7925eca1f5b8812819eec3bf8fc67f75..939a8450cb68a153f4b2600533937deaed8a1979 100644 (file)
@@ -349,12 +349,18 @@ float file_string_width(const char* str)
 
 float file_font_pointsize()
 {
+#if 0
        float s;
        char tmp[2] = "X";
        uiStyle *style= U.uistyles.first;
        uiStyleFontSet(&style->widget);
        s = BLF_height(style->widget.uifont_id, tmp);
        return style->widget.points;
+#else
+       uiStyle *style= U.uistyles.first;
+       uiStyleFontSet(&style->widget);
+       return style->widget.points;
+#endif
 }
 
 static void column_widths(struct FileList* files, struct FileLayout* layout)
index 4f529df24dcb2da3f896d8afb3ee86d0f752553f..95c499c263bb05cfadacbd7b2591c22ac77c4a28 100644 (file)
@@ -299,7 +299,7 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
        RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1);
        
                /* borderselect */
-       kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, 0, 0);
        kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0);
                RNA_boolean_set(kmi->ptr, "axis_range", 1);
                
index d1230d82f71324800133bb31e8e69e8711d6fd67..3f4c10c8155ea4b86d874cd44541d049abef9ee6 100644 (file)
@@ -438,14 +438,12 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
 {
        SpaceImage *sima;
        ARegion *ar;
-       Object *obedit;
        float aspx, aspy, zoomx, zoomy, w, h;
        int width, height;
 
        /* retrieve state */
        sima= CTX_wm_space_image(C);
        ar= CTX_wm_region(C);
-       obedit= CTX_data_edit_object(C);
 
        ED_space_image_size(sima, &width, &height);
        ED_space_image_aspect(sima, &aspx, &aspy);
index b0634ff25c71a805fbe252ceb6e38c9f4a83ad88..c8766f5c4c19dd978c30cc1a8bc5d6e9a9c0713d 100644 (file)
@@ -4771,8 +4771,6 @@ void logic_buttons(bContext *C, ARegion *ar)
        uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator");
        uiBlockEndAlign(block);
        
-       ob= CTX_data_active_object(C);
-       
        for(a=0; a<count; a++) {
                unsigned int controller_state_mask = 0; /* store a bitmask for states that are used */
                
index 2a03f00e7872ed69089404310accfc3e84f68f0d..650205c2f44e3e138e769653279aec5bee913f92 100644 (file)
@@ -296,7 +296,6 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
 static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
        bAnimContext ac;
-       Scene *scene;
        ARegion *ar;
        View2D *v2d;
        int mval[2], channel_index;
@@ -309,7 +308,6 @@ static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *e
                return OPERATOR_CANCELLED;
                
        /* get useful pointers from animation context data */
-       scene= ac.scene;
        ar= ac.ar;
        v2d= &ar->v2d;
        
index 901aaba2cb128d44da8bb81d661d660321056e20..f16078ba454b27e055bcdfd5b6dec169c503a87a 100644 (file)
@@ -760,7 +760,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
 /* smat, imat = mat & imat to draw screenaligned */
 static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
 {
-       float head, tail, length;
+       float head, tail /*, length*/;
        float *headvec, *tailvec, dirvec[3];
        
        /* figure out the sizes of spheres */
@@ -768,7 +768,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag,
                /* this routine doesn't call get_matrix_editbone() that calculates it */
                ebone->length = len_v3v3(ebone->head, ebone->tail);
                
-               length= ebone->length;
+               /*length= ebone->length;*/ /*UNUSED*/
                tail= ebone->rad_tail;
                if (ebone->parent && (boneflag & BONE_CONNECTED))
                        head= ebone->parent->rad_tail;
@@ -778,7 +778,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag,
                tailvec= ebone->tail;
        }
        else {
-               length= pchan->bone->length;
+               /*length= pchan->bone->length;*/ /*UNUSED*/
                tail= pchan->bone->rad_tail;
                if ((pchan->parent) && (boneflag & BONE_CONNECTED))
                        head= pchan->parent->bone->rad_tail;
index 3047df06523e79911342963387182528093930c2..82cec1eec428ff12c70506b2ff3b60835708d9cc 100644 (file)
@@ -408,7 +408,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
 
        if (flags & P_CONSTRAINT)
        {
-               prop= RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
+               RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
                prop= RNA_def_property(ot->srna, "constraint_orientation", PROP_ENUM, PROP_NONE);
                RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
                RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
@@ -455,7 +455,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
        }
 
        // Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit
-       prop = RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
+       /*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
        //RNA_def_property_flag(prop, PROP_HIDDEN);
 }
 
index 3eae81d52f120c4f1c0c2909294888bc37510165..089f192cdc82b5f4cd3f9bf94c17849d69d3fa3c 100644 (file)
@@ -1591,8 +1591,7 @@ int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mv
                Object *ob = base->object;
                retval |= snapObject(scene, ar, ob, 0, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth);
        }
-       
-       base= FIRSTBASE;
+
        for ( base = FIRSTBASE; base != NULL; base = base->next ) {
                if ( BASE_VISIBLE(v3d, base) && (base->flag & (BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA)) == 0 && ((mode == SNAP_NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) || (ELEM(mode, SNAP_ALL, SNAP_NOT_OBEDIT) && base != BASACT)) ) {
                        Object *ob = base->object;
index 033cfdc2912daa3ce767ce603b7cefa857f3e55d..8a2a52df2c8a810311e785fce961312e29d40f80 100644 (file)
@@ -1086,7 +1086,6 @@ typedef struct UVVertAverage {
 
 static int stitch_exec(bContext *C, wmOperator *op)
 {
-       SpaceImage *sima;
        Scene *scene;
        Object *obedit;
        EditMesh *em;
@@ -1094,8 +1093,7 @@ static int stitch_exec(bContext *C, wmOperator *op)
        EditVert *eve;
        Image *ima;
        MTFace *tf;
-       
-       sima= CTX_wm_space_image(C);
+
        scene= CTX_data_scene(C);
        obedit= CTX_data_edit_object(C);
        em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
index dfaf251f4c5856ccb6ff20730eb940a76fa4932e..dedcab91e06bf1067e88dcde342ee63d79fc24ec 100644 (file)
@@ -776,9 +776,9 @@ void GPU_free_smoke(SmokeModifierData *smd)
 
 void GPU_create_smoke(SmokeModifierData *smd, int highres)
 {
-       if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex && !highres)
+       if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && !highres)
                smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smoke_get_density(smd->domain->fluid));
-       else if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex && highres)
+       else if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && highres)
                smd->domain->tex = GPU_texture_create_3D(smd->domain->res_wt[0], smd->domain->res_wt[1], smd->domain->res_wt[2], smoke_turbulence_get_density(smd->domain->wt));
 
        smd->domain->tex_shadow = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->shadow);
index 4e5dc5923fe5e0f5ff9b2389900b870351465835..5c3451fd6f4babb223313c1eb65f80808373da63 100644 (file)
@@ -760,7 +760,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
                                
                                if (samplesperpixel == 4) {
                                        to16[to_i+3] = FTOUSHORT(fromf[from_i+3]);
-                                       to_i++; from_i++;
+                                       /*to_i++; from_i++;*/ /*unused, set on each loop */
                                }
                        }
                        else {
index f9fa10f4a321c23c2c92c21f56380953bffa24ec..e366b0c61b990c1074d002fe3c796db821daabab 100644 (file)
@@ -676,7 +676,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
        func = RNA_def_function(srna, "new", "rna_NlaTrack_new");
        RNA_def_function_flag(func, FUNC_USE_CONTEXT);
        RNA_def_function_ui_description(func, "Add a new NLA Tracks");
-       parm = RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after.");
+       RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after.");
        /* return type */
        parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track.");
        RNA_def_function_return(func, parm);
index a257356f6c90fd6178ed4bd36e63cac9cdeadc76..8ffd98b8d88650adbf584bb71395043e54467366 100644 (file)
@@ -1145,7 +1145,7 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
        func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
        RNA_def_function_ui_description(func, "Add a number of points to this spline.");
        RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
-       parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+       RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
 
        /*
        func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
index 491defcd01610f5cdf41da695e62e5b16af860f7..12ecf15816a10b11130e3d0623d722df011c223f 100644 (file)
@@ -1346,7 +1346,7 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
        parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove.");
        RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
        /* optional */
-       parm= RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time");
+       RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time");
 }
 
 static void rna_def_fcurve(BlenderRNA *brna)
index 1e6db94f7a3f21292d1456932bb840db346b34a0..08065b905303fc3865fa928f93962dac79471b6e 100644 (file)
@@ -1650,7 +1650,7 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
 //     PropertyRNA *prop;
 
        FunctionRNA *func;
-       PropertyRNA *parm;
+//     PropertyRNA *parm;
 
        RNA_def_property_srna(cprop, "MeshVertices");
        srna= RNA_def_struct(brna, "MeshVertices", NULL);
@@ -1659,7 +1659,7 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
 
        func= RNA_def_function(srna, "add", "ED_mesh_vertices_add");
        RNA_def_function_flag(func, FUNC_USE_REPORTS);
-       parm= RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+       RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
 }
 
 /* mesh.edges */
@@ -1688,7 +1688,7 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
        PropertyRNA *prop;
 
        FunctionRNA *func;
-       PropertyRNA *parm;
+       /*PropertyRNA *parm;*/
 
        RNA_def_property_srna(cprop, "MeshFaces");
        srna= RNA_def_struct(brna, "MeshFaces", NULL);
@@ -1707,7 +1707,7 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
 
        func= RNA_def_function(srna, "add", "ED_mesh_faces_add");
        RNA_def_function_flag(func, FUNC_USE_REPORTS);
-       parm= RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+       RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
 }
 
 /* mesh.vertex_colors */
index f1d41d866950a8024435ec6af49b1920a7d46c1b..142c80172895bb44289020020cd89afb79e333fc 100644 (file)
@@ -232,7 +232,7 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop)
 
        func= RNA_def_function(srna, "new", "rna_MetaBall_elements_new");
        RNA_def_function_ui_description(func, "Add a new spline to the curve.");
-       parm= RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta element.");
+       RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta element.");
        parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created metaelement.");
        RNA_def_function_return(func, parm);
 
index e40506fcd83fa025b2b9ec08b65bf5f457dc4917..7184fd05dcf2929455cb71ba86f86acd634e4912 100644 (file)
@@ -2386,7 +2386,7 @@ static void rna_def_composite_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
        RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
        parm= RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add");
        RNA_def_property_flag(parm, PROP_REQUIRED);
-       parm= RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
+       RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
        /* return value */
        parm= RNA_def_pointer(func, "node", "Node", "", "New node.");
        RNA_def_function_return(func, parm);
@@ -2414,7 +2414,7 @@ static void rna_def_shader_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
        RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
        parm= RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add");
        RNA_def_property_flag(parm, PROP_REQUIRED);
-       parm= RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
+       RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
        /* return value */
        parm= RNA_def_pointer(func, "node", "Node", "", "New node.");
        RNA_def_function_return(func, parm);
@@ -2442,7 +2442,7 @@ static void rna_def_texture_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
        RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
        parm= RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add");
        RNA_def_property_flag(parm, PROP_REQUIRED);
-       parm= RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
+       RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
        /* return value */
        parm= RNA_def_pointer(func, "node", "Node", "", "New node.");
        RNA_def_function_return(func, parm);
index 6cb5a074c037b49b2e0f6c2d5c2d2cc7148c80e9..35e19c6b6b7aa380800ebeff1338abbc557bef2b 100644 (file)
@@ -1658,7 +1658,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
        /* vertex groups */ // add_vertex_group
        func= RNA_def_function(srna, "new", "rna_Object_vgroup_new");
        RNA_def_function_ui_description(func, "Add vertex group to object.");
-       parm= RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */
+       RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */
        parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group.");
        RNA_def_function_return(func, parm);
 
index a9e43d35f32c0ace04ec46b183c459da8d1fb2af..f3f8db6fb3998abea9b3cdac697bfc0d7845dc74 100644 (file)
@@ -107,7 +107,6 @@ static void rna_def_area(BlenderRNA *brna)
        StructRNA *srna;
        PropertyRNA *prop;
        FunctionRNA *func;
-       PropertyRNA *parm;
        
        srna= RNA_def_struct(brna, "Area", NULL);
        RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor");
@@ -144,7 +143,7 @@ static void rna_def_area(BlenderRNA *brna)
 
        func= RNA_def_function(srna, "header_text_set", "ED_area_headerprint");
        RNA_def_function_ui_description(func, "Set the header text");
-       parm= RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text.");
+       RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text.");
 }
 
 static void rna_def_region(BlenderRNA *brna)
index e6d6759a449be02e4b9c949680986b669512a8f4..022f818d7d757e6959cec662659501b1ff5ccbe5 100644 (file)
@@ -141,7 +141,7 @@ void RNA_api_ui_layout(StructRNA *srna)
        RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
 
        func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
-       parm= RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX);
+       RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX);
        parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
        RNA_def_function_return(func, parm);
        RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
@@ -327,7 +327,7 @@ void RNA_api_ui_layout(StructRNA *srna)
        RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc.");
        parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock.");
        RNA_def_property_flag(parm, PROP_REQUIRED);
-       parm= RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?");
+       RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?");
        RNA_def_pointer(func, "parent", "ID", "", "ID datablock.");
        RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot.");
 
index a0dbc2d5ff24a6a0b7c8a65f463dec8e817b6db1..ab13f9928c24a14d05a38cb9bfd98ba602f6517b 100644 (file)
@@ -239,11 +239,11 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int
 
 static int py_to_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix)
 {
-       int totdim, dim_size[MAX_ARRAY_DIMENSION];
+       /*int totdim, dim_size[MAX_ARRAY_DIMENSION];*/
        int totitem;
        char *data= NULL;
 
-       totdim= RNA_property_array_dimension(ptr, prop, dim_size);
+       /*totdim= RNA_property_array_dimension(ptr, prop, dim_size);*/ /*UNUSED*/
 
        if (!validate_array(py, ptr, prop, 0, check_item_type, item_type_str, &totitem, error_prefix)) {
                return 0;
index 0cf3522eaf3f8b4f423ca503f73b39323f83cb37..7d5cdb8a10c0c0663f37db558fc7508c6cdb7ce7 100644 (file)
@@ -715,7 +715,7 @@ int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerR
                                        ARegion *ar= CTX_wm_region(C);
                                        ScrArea *sa= CTX_wm_area(C);
 
-                                       if(ar && ar->regiontype == RGN_TYPE_WINDOW && BLI_in_rcti(&ar->winrct, event->x, event->y)) {
+                                       if(ar && ar->regiontype == RGN_TYPE_WINDOW && event && BLI_in_rcti(&ar->winrct, event->x, event->y)) {
                                                winrect= &ar->winrct;
                                        }
                                        else if(sa) {