remove redundant assignments & unused vars.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 12 Jan 2011 03:41:12 +0000 (03:41 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 12 Jan 2011 03:41:12 +0000 (03:41 +0000)
also minor functional changes
- OBJECT_OT_make_links_data() type property is now assigned to the operator property (so popup menu can find it)
- removing BG image now returns cancelled if no image is removed.

37 files changed:
source/blender/blenfont/intern/blf.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenlib/intern/graph.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/curve/editcurve.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_relations.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/imbuf/intern/divers.c
source/blender/modifiers/intern/MOD_smoke.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_gesture.c

index 3ac0b8449b0e89f903b94c5676f3da1c86fb63d1..462ecebc10a9bffa9c76da4468bbc0077ea0efd4 100644 (file)
@@ -140,7 +140,7 @@ int BLF_load(const char *name)
        /* check if we already load this font. */
        i= blf_search(name);
        if (i >= 0) {
-               font= global_font[i];
+               /*font= global_font[i];*/ /*UNUSED*/
                return(i);
        }
 
@@ -225,7 +225,7 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
 
        i= blf_search(name);
        if (i >= 0) {
-               font= global_font[i];
+               /*font= global_font[i];*/ /*UNUSED*/
                return(i);
        }
 
index 674836ac859c26c7e978f6a135d91f11f0f4110b..424d15f6a7e4b15c56a73f8b9570bc3426907d70 100644 (file)
@@ -1795,7 +1795,6 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                                                        dl->rt= nu->flag & ~CU_2D;
 
                                                        dl->bevelSplitFlag= MEM_callocN(sizeof(*dl->col2)*((bl->nr+0x1F)>>5), "bevelSplitFlag");
-                                                       bevp= (BevPoint *)(bl+1);
        
                                                        /* for each point of poly make a bevel piece */
                                                        bevp= (BevPoint *)(bl+1);
index ecaa15c8f7da65929ed09e3657fa40ebc2c954a3..9684e18b94934b4eb8d71b5072371c01b9656495 100644 (file)
@@ -696,7 +696,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
 
        // Create unicode string
        utf8len = utf8slen(cu->str);
-       tmp = mem = MEM_callocN(((utf8len + 1) * sizeof(wchar_t)), "convertedmem");
+       mem = MEM_callocN(((utf8len + 1) * sizeof(wchar_t)), "convertedmem");
        
        utf8towchar(mem, cu->str);
 
index 58e3b4ba55231c83f78df0b066990137952b6abe..d8876705ebb5ad8e59c7f475f6daed83f0251c1a 100644 (file)
@@ -914,10 +914,10 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
        }
        
        if (scene->r.stamp & R_STAMP_TIME) {
-               int h, m, s, f;
-               h= m= s= f= 0;
-               f = (int)(scene->r.cfra % scene->r.frs_sec);
-               s = (int)(scene->r.cfra / scene->r.frs_sec);
+               int f = (int)(scene->r.cfra % scene->r.frs_sec);
+               int s = (int)(scene->r.cfra / scene->r.frs_sec);
+               int h= 0;
+               int m= 0;
 
                if (s) {
                        m = (int)(s / 60);
index 0df456a443d384597fd1206f7b24dbcc3adf63a8..fc9c41070dcef9493e5b677e8cf6fe3849d7684c 100644 (file)
@@ -1229,7 +1229,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
        float vel[3];
        float k = 0.0f;
        float L = s->restlen;
-       float cb = clmd->sim_parms->structural;
+       float cb; /* = clmd->sim_parms->structural; */ /*UNUSED*/
 
        float nullf[3] = {0,0,0};
        float stretch_force[3] = {0,0,0};
@@ -1566,7 +1566,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
        float           tm2[3][3]       = {{0}};
        MFace           *mfaces         = cloth->mfaces;
        unsigned int numverts = cloth->numverts;
-       LinkNode *search = cloth->springs;
+       LinkNode *search;
        lfVector *winvec;
        EffectedPoint epoint;
 
index db826b838640ed0c85c0698402f43cd47b88e77f..7c3e90dc375f7791e91c775e37165713125dbed3 100644 (file)
@@ -2847,7 +2847,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
        ParticleEditSettings *pset = &sim->scene->toolsettings->particle;
        ParticleSystem *psys = sim->psys;
        ParticleSettings *part = psys->part;
-       ParticleCacheKey *ca, **cache= psys->pathcache;
+       ParticleCacheKey *ca, **cache;
 
        DerivedMesh *hair_dm = (psys->part->type==PART_HAIR && psys->flag & PSYS_HAIR_DYNAMICS) ? psys->hair_out_dm : NULL;
        
index 37ce6c94eb792bd95e3ad029811e6f53e3530c28..0044c86f4f7fdc9a05d1560745eff82728e03637 100644 (file)
@@ -2025,8 +2025,6 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
                        PTCacheMem *pm= pid->cache->mem_cache.first;
                        PTCacheMem *link= NULL;
 
-                       pm= pid->cache->mem_cache.first;
-
                        if(mode == PTCACHE_CLEAR_ALL) {
                                /*we want startframe if the cache starts before zero*/
                                pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
@@ -2207,8 +2205,6 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
                else {
                        PTCacheMem *pm= pid->cache->mem_cache.first;
 
-                       pm= pid->cache->mem_cache.first;
-
                        while(pm) {
                                if(pm->frame >= sta && pm->frame <= end)
                                        cache->cached_frames[pm->frame-sta] = 1;
index a96b2d20976158428adf0447bdc7d60926e92aec..e187595aa11e4ba0883e658a1d4f555b72328472 100644 (file)
@@ -410,7 +410,7 @@ int BLI_isGraphCyclic(BGraph *graph)
 
 BArc * BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v)
 {
-       BArc *nextArc = arc->next;
+       BArc *nextArc;
        
        for(nextArc = graph->arcs.first; nextArc; nextArc = nextArc->next)
        {
index e9d0645ceba225925be9f02f8e9d0736596d858f..d4f25c10e30df27949263ab18b4d99585a3b499c 100644 (file)
@@ -1691,7 +1691,7 @@ void generateMissingArcsFromNode(RigGraph *rigg, ReebNode *node, int multi_level
 
 void generateMissingArcs(RigGraph *rigg)
 {
-       ReebGraph *reebg = rigg->link_mesh;
+       ReebGraph *reebg;
        int multi_level_limit = 5;
        
        for (reebg = rigg->link_mesh; reebg; reebg = reebg->link_up)
index 73db7b1a377ec043ea064ea9da7bf75f7c4d2129..ce4a61b5cff1189e1af001b332053d5ae90572bf 100644 (file)
@@ -2194,7 +2194,7 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
                                /* loop over selection segments of a curve, smooth each */
                                
                                /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
-                               start_sel = end_sel = -1;
+                               start_sel = -1;
                                for(bezt=nu->bezt+last_sel, a=last_sel; a<nu->pntsu; a++, bezt++) {
                                        if(bezt->f2 & SELECT) {
                                                start_sel = a;
@@ -2256,7 +2256,7 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
                                /* loop over selection segments of a curve, smooth each */
                                
                                /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
-                               start_sel = end_sel = -1;
+                               start_sel = -1;
                                for(bp=nu->bp+last_sel, a=last_sel; a<nu->pntsu; a++, bp++) {
                                        if(bp->f1 & SELECT) {
                                                start_sel = a;
index f719d41e7b6d5aba10f1063fd88b3263b6c2ba02..ffb18bcad4df7811908d55d69f024d22e670382d 100644 (file)
@@ -3461,7 +3461,7 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
                if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
                        CurveMapping *cumap= (CurveMapping*)but->poin;
                        CurveMap *cuma= cumap->cm+cumap->cur;
-                       CurveMapPoint *cmp= cuma->curve;
+                       CurveMapPoint *cmp;
                        float fx, fy, zoomx, zoomy, offsx, offsy;
                        float dist, mindist= 200.0f; // 14 pixels radius
                        int sel= -1;
index 69e866d9c1c366e1f75842f5cd36961d5529a012..1f25f96821325cab8f2ee8e15391e8c502130d1a 100644 (file)
@@ -2334,7 +2334,6 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event)
 void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
 {
        bScreen *screen= CTX_wm_screen(C);
-       Scene *scene= CTX_data_scene(C);
        wmWindowManager *wm= CTX_wm_manager(C);
        ScrArea *sa= CTX_wm_area(C);
        uiBlock *block;
@@ -2352,6 +2351,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
                handle_event= B_STOPCOMPO;
        } 
        else {
+               Scene *scene;
                /* another scene can be rendering too, for example via compositor */
                for(scene= CTX_data_main(C)->scene.first; scene; scene= scene->id.next)
                        if(WM_jobs_test(wm, scene))
index b2f74e435b11451b7de7260b20f12c24fb262bce..5e3a0c6022aa00f3ac302b6897a7aaf87473bdb9 100644 (file)
@@ -466,7 +466,7 @@ static void ui_theme_init_new(bTheme *btheme)
 */
 void ui_theme_init_default(void)
 {
-       bTheme *btheme= U.themes.first;
+       bTheme *btheme;
        
        /* we search for the theme with name Default */
        for(btheme= U.themes.first; btheme; btheme= btheme->next) {
index 1f70dd84d9410bf5dff6b0b3b3115d0ea973ce18..3647d32c28d10b454d8bfb8567bff79af91880fc 100644 (file)
@@ -86,8 +86,6 @@ void make_editLatt(Object *obedit)
 
        free_editLatt(obedit);
 
-       lt= obedit->data;
-
        actkey= ob_get_keyblock(obedit);
        if(actkey)
                key_to_latt(actkey, lt);
index ab53a95a1560d0f76e126e72789eb01b71845017..a0d8e3c9733b36d68474c0946479ad113abb70a8 100644 (file)
@@ -1338,8 +1338,6 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot)
                {MAKE_LINKS_MODIFIERS,  "MODIFIERS", 0, "Modifiers", ""},
                {0, NULL, 0, NULL, NULL}};
 
-       PropertyRNA *prop;
-
        /* identifiers */
        ot->name= "Link Data";
        ot->description = "Make links from the active object to other selected objects";
@@ -1353,7 +1351,7 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
        /* properties */
-       prop= RNA_def_enum(ot->srna, "type", make_links_items, 0, "Type", "");
+       ot->prop= RNA_def_enum(ot->srna, "type", make_links_items, 0, "Type", "");
 }
 
 
@@ -1464,7 +1462,8 @@ void single_obdata_users(Main *bmain, Scene *scene, int flag)
                                        ob->data= copy_camera(ob->data);
                                        break;
                                case OB_MESH:
-                                       me= ob->data= copy_mesh(ob->data);
+                                       ob->data= copy_mesh(ob->data);
+                                       //me= ob->data;
                                        //if(me && me->key)
                                        //      ipo_idnew(me->key->ipo);        /* drivers */
                                        break;
index 82c2f614af1691b80b043c7ab40413bdde7d7c7a..6f4f996d00427219481f71360deebe53ba1d43d5 100644 (file)
@@ -639,9 +639,8 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
                }
        }
        else {
-               xi = (int)((uv[0]*ibuf->x) + 0.5f);
-               yi = (int)((uv[1]*ibuf->y) + 0.5f);
-               
+               //xi = (int)((uv[0]*ibuf->x) + 0.5f);
+               //yi = (int)((uv[1]*ibuf->y) + 0.5f);
                //if (xi<0 || xi>=ibuf->x  ||  yi<0 || yi>=ibuf->y) return 0;
                
                /* wrap */
index a62f01e88f0b6da1c2706f83da6998a485ed3384..832d657428c61dc438b83e7447c1cf9ab53fbb39 100644 (file)
@@ -1430,7 +1430,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        Object *ob;
        Mesh *me;
        float mat[4][4];
-       float paintweight= ts->vgroup_weight;
+       float paintweight;
        int *indexar;
        int totindex, index, totw, flip;
        float alpha;
index 825b462c08f7305d61c784a8296c0be66c02911a..4719c10e94144b0bde62c4dd75ce598e1bd9d3d0 100644 (file)
@@ -442,7 +442,6 @@ static void insert_action_keys(bAnimContext *ac, short mode)
        
        ReportList *reports = ac->reports;
        Scene *scene= ac->scene;
-       float cfra= (float)CFRA;
        short flag = 0;
        
        /* filter data */
@@ -459,7 +458,8 @@ static void insert_action_keys(bAnimContext *ac, short mode)
        for (ale= anim_data.first; ale; ale= ale->next) {
                AnimData *adt= ANIM_nla_mapping_get(ac, ale);
                FCurve *fcu= (FCurve *)ale->key_data;
-               
+               float cfra;
+
                /* adjust current frame for NLA-scaling */
                if (adt)
                        cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
index 84090c88abc4efffed03e2f63f2013cc2f7f3035..98547dbe7981f031dfeafd107d07d839fd00e722 100644 (file)
@@ -280,12 +280,12 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
 {
        uiBut *but;
        float x,y;
-       float alpha=1.0f;
+       /*float alpha=1.0f;*/
        
        x = (float)(sx);
        y = (float)(sy-height);
        
-       if (icon == ICON_FILE_BLANK) alpha = 0.375f;
+       /*if (icon == ICON_FILE_BLANK) alpha = 0.375f;*/
                
        but= uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0, 0.0, 0, 0, "");
        uiButSetDragPath(but, path);
index 154c955c48e15cac420a85532929cbaf9db4fbde..fe9296b7227cd12651f5da974d00298d3cee2025 100644 (file)
@@ -410,7 +410,6 @@ static void insert_graph_keys(bAnimContext *ac, short mode)
        
        ReportList *reports = ac->reports;
        Scene *scene= ac->scene;
-       float cfra= (float)CFRA;
        short flag = 0;
        
        /* filter data */
@@ -426,6 +425,7 @@ static void insert_graph_keys(bAnimContext *ac, short mode)
        for (ale= anim_data.first; ale; ale= ale->next) {
                AnimData *adt= ANIM_nla_mapping_get(ac, ale);
                FCurve *fcu= (FCurve *)ale->key_data;
+               float cfra;
                
                /* adjust current frame for NLA-mapping */
                if (adt)
index 69bbfb78d811f353e952c732ecec354f6551d304..d1230d82f71324800133bb31e8e69e8711d6fd67 100644 (file)
@@ -438,7 +438,6 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
 {
        SpaceImage *sima;
        ARegion *ar;
-       Scene *scene;
        Object *obedit;
        float aspx, aspy, zoomx, zoomy, w, h;
        int width, height;
@@ -446,7 +445,6 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
        /* retrieve state */
        sima= CTX_wm_space_image(C);
        ar= CTX_wm_region(C);
-       scene= (Scene*)CTX_data_scene(C);
        obedit= CTX_data_edit_object(C);
 
        ED_space_image_size(sima, &width, &height);
@@ -2030,7 +2028,7 @@ static int record_composite_exec(bContext *C, wmOperator *op)
 
 static int record_composite_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
-       RecordCompositeData *rcd= op->customdata;
+       RecordCompositeData *rcd;
        
        if(!record_composite_init(C, op))
                return OPERATOR_CANCELLED;
index c911adb0c164f7da75bc04618c79838a1284fe42..af4e496f68a7728f2b65fcc1a0f9b2f2e8f241ee 100644 (file)
@@ -586,13 +586,13 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
                MTFace *tf;
                
                if(em && EM_texFaceCheck(em)) {
-                       sima->image= ima= NULL;
+                       sima->image= NULL;
                        
                        tf = EM_get_active_mtface(em, NULL, NULL, 1); /* partially selected face is ok */
                        
                        if(tf && (tf->mode & TF_TEX)) {
                                /* don't need to check for pin here, see above */
-                               sima->image= ima= tf->tpage;
+                               sima->image= tf->tpage;
                                
                                if(sima->flag & SI_EDITTILE);
                                else sima->curtile= tf->tile;
index eb7ae1d80112ab9d4aadf4f70ab04d01a19aaa11..ad54eff1fd4b44cc8d26760fcfba514d91c13b35 100644 (file)
@@ -201,7 +201,6 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
 
        Sequence *seq;  /* generic strip vars */
        Strip *strip;
-       StripElem *se;
        
        int start_frame, channel; /* operator props */
        
@@ -227,7 +226,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
        strip->len = seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1;
        strip->us= 1;
        
-       strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+       strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
        
        strcpy(seq->name+2, sce_seq->id.name+2);
        seqbase_unique_name_recursive(&ed->seqbase, seq);
@@ -559,7 +558,6 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
 
        Sequence *seq;  /* generic strip vars */
        Strip *strip;
-       StripElem *se;
        struct SeqEffectHandle sh;
 
        int start_frame, end_frame, channel, type; /* operator props */
@@ -614,7 +612,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
        strip->len = seq->len;
        strip->us= 1;
        if(seq->len>0)
-               strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+               strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
 
        if (seq->type==SEQ_PLUGIN) {
                char path[FILE_MAX];
index 318c64f87a75bd1dffd2e157087e7ca7b7cb1e42..eb69374b5b7872ca2c4831aded006d9bd87085f7 100644 (file)
@@ -1029,10 +1029,8 @@ static TextLine *first_visible_line(SpaceText *st, ARegion *ar, int *wrap_top)
        Text *text= st->text;
        TextLine* pline= text->lines.first;
        int i= st->top, lineno= 0;
-       DrawCache *drawcache;
 
        text_update_drawcache(st, ar);
-       drawcache= (DrawCache *)st->drawcache;
 
        if(wrap_top) *wrap_top= 0;
 
index 18a83e16ca18075fc054af8a87cb0e0d0132ab87..901aaba2cb128d44da8bb81d661d660321056e20 100644 (file)
@@ -630,15 +630,15 @@ static float co[16] ={
 /* smat, imat = mat & imat to draw screenaligned */
 static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel *pchan, EditBone *ebone)
 {
-       float head, tail, length, dist;
+       float head, tail, dist /*, length*/;
        float *headvec, *tailvec, dirvec[3];
        
        /* figure out the sizes of spheres */
        if (ebone) {
                /* 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;
                dist= ebone->dist;
                if (ebone->parent && (ebone->flag & BONE_CONNECTED))
@@ -649,7 +649,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
                tailvec= ebone->tail;
        }
        else {
-               length= pchan->bone->length;
+               /*length= pchan->bone->length;*/ /*UNUSED*/
                tail= pchan->bone->rad_tail;
                dist= pchan->bone->dist;
                if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED))
index c6cbfe44df4d45bdae5a7f4506aeec7a4f8e202d..caac8d1d9fe087aeaca4ed6d2a7e3c2dc284de9a 100644 (file)
@@ -93,13 +93,10 @@ static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
        EdgeHash *eh = BLI_edgehash_new();
        int i;
        MFace *mf;
-       MTFace *tf = NULL;
        
        for (i=0; i<me->totface; i++) {
                mf = &me->mface[i];
-               if (me->mtface)
-                       tf = &me->mtface[i];
-               
+
                if (mf->v3) {
                        if (!(mf->flag&ME_HIDE)) {
                                unsigned int flags = eEdge_Visible;
index 19353e9f29e6f049a42a12d2a19f7f690b246384..26445c4d7422f67847de3f9f8db60dfa5c0284b4 100644 (file)
@@ -3448,7 +3448,6 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
 static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, ParticleSystem *psys, int ob_dt)
 {
        Object *ob=base->object;
-       ParticleSystemModifierData *psmd;
        ParticleEditSettings *pset = PE_settings(scene);
        ParticleSettings *part;
        ParticleData *pars, *pa;
@@ -3460,7 +3459,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
        float vel[3], imat[4][4];
        float timestep, pixsize=1.0, pa_size, r_tilt, r_length;
        float pa_time, pa_birthtime, pa_dietime, pa_health;
-       float cfra= bsystem_time(scene, ob,(float)CFRA,0.0);
+       float cfra;
        float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f;
        int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0;
        int select=ob->flag&SELECT, create_cdata=0, need_v=0;
@@ -3496,7 +3495,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
        sim.scene= scene;
        sim.ob= ob;
        sim.psys= psys;
-       sim.psmd = psmd = psys_get_modifier(ob,psys);
+       sim.psmd = psys_get_modifier(ob,psys);
 
        if(part->phystype==PART_PHYS_KEYED){
                if(psys->flag&PSYS_KEYED){
index 35cddda53627ae8081c3a4148f12eb38e6e92780..4eeacd6f05f992691d51a5eb5ed769cb20d4d869 100644 (file)
@@ -2314,20 +2314,21 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot)
 /* ***** remove image operator ******* */
 static int background_image_remove_exec(bContext *C, wmOperator *op)
 {
-       BGpic *bgpic_rem = CTX_data_pointer_get_type(C, "bgpic", &RNA_BackgroundImage).data;
        View3D *vd = CTX_wm_view3d(C);
        int index = RNA_int_get(op->ptr, "index");
+       BGpic *bgpic_rem= BLI_findlink(&vd->bgpicbase, index);
 
-       bgpic_rem = BLI_findlink(&vd->bgpicbase, index);
        if(bgpic_rem) {
                BLI_remlink(&vd->bgpicbase, bgpic_rem);
                if(bgpic_rem->ima) bgpic_rem->ima->id.us--;
                MEM_freeN(bgpic_rem);
+               WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd);
+               return OPERATOR_FINISHED;
+       }
+       else {
+               return OPERATOR_CANCELLED;
        }
 
-       WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, vd);
-
-       return OPERATOR_FINISHED;
 }
 
 void VIEW3D_OT_background_image_remove(wmOperatorType *ot)
index a259e29e9a026ef1f9d58705eb0a144052a6f4d2..2f7a24d600fe8d61b287d932255e5be009edc719 100644 (file)
@@ -1743,7 +1743,6 @@ int ED_view3d_context_activate(bContext *C)
        bScreen *sc= CTX_wm_screen(C);
        ScrArea *sa= CTX_wm_area(C);
        ARegion *ar;
-       RegionView3D *rv3d;
 
        /* sa can be NULL when called from python */
        if(sa==NULL || sa->spacetype != SPACE_VIEW3D)
@@ -1764,7 +1763,6 @@ int ED_view3d_context_activate(bContext *C)
        // bad context switch ..
        CTX_wm_area_set(C, sa);
        CTX_wm_region_set(C, ar);
-       rv3d= ar->regiondata;
 
        return 1;
 }
index 65e58d8a6082f462acf74961fb88a89f6e799a53..23f4f103eae191aa5b48433ed43e3afffb08ed27 100644 (file)
@@ -4849,18 +4849,16 @@ int doEdgeSlide(TransInfo *t, float perc)
        LinkNode *vertlist=sld->vertlist, *look;
        GHash *vertgh = sld->vhash;
        TransDataSlideVert *tempsv;
-       float len = 0.0f;
+       float len;
        int prop=1, flip=0;
        /* UV correction vars */
        GHash **uvarray= sld->uvhash;
        int  uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
        int uvlay_idx;
-       TransDataSlideUv *suv=sld->slideuv;
+       TransDataSlideUv *suv;
        float uv_tmp[2];
        LinkNode *fuv_link;
 
-       len = 0.0f;
-
        tempsv = BLI_ghash_lookup(vertgh,nearest);
 
        centerVert = editedge_getSharedVert(tempsv->up, tempsv->down);
index 55699a345c245181e0f16507f20ad27892a335cb..3047df06523e79911342963387182528093930c2 100644 (file)
@@ -838,39 +838,38 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
        switch(spaceid)
        {
                case SPACE_VIEW3D:
-                       km = WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
 
-                       km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
+                       WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_WARP, WKEY, KM_PRESS, KM_SHIFT, 0);
+                       WM_keymap_add_item(keymap, OP_WARP, WKEY, KM_PRESS, KM_SHIFT, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_TOSPHERE, SKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
+                       WM_keymap_add_item(keymap, OP_TOSPHERE, SKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_SHEAR, SKEY, KM_PRESS, KM_ALT|KM_CTRL|KM_SHIFT, 0);
+                       WM_keymap_add_item(keymap, OP_SHEAR, SKEY, KM_PRESS, KM_ALT|KM_CTRL|KM_SHIFT, 0);
 
-                       km = WM_keymap_add_item(keymap, "TRANSFORM_OT_select_orientation", SPACEKEY, KM_PRESS, KM_ALT, 0);
+                       WM_keymap_add_item(keymap, "TRANSFORM_OT_select_orientation", SPACEKEY, KM_PRESS, KM_ALT, 0);
 
                        km = WM_keymap_add_item(keymap, "TRANSFORM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
                        RNA_boolean_set(km->ptr, "use", 1);
 
-                       km = WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0);
+                       WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0);
 
                        km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
                        RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap");
 
-                       km = WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
-                       
+                       WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+
                        km = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0);
                        RNA_boolean_set(km->ptr, "texture_space", 1);
-                       
+
                        km = WM_keymap_add_item(keymap, OP_RESIZE, TKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
                        RNA_boolean_set(km->ptr, "texture_space", 1);
 
-
                        break;
                case SPACE_ACTION:
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
@@ -889,16 +888,16 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
                        RNA_int_set(km->ptr, "mode", TFM_TIME_SLIDE);
                        break;
                case SPACE_IPO:
-                       km= WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
                        
-                       km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
+                       WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
                        
-                       km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
                        
-                       km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
                        break;
                case SPACE_NLA:
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
@@ -914,35 +913,35 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
                        RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE);
                        break;
                case SPACE_NODE:
-                       km= WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
 
                        km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0);
                        RNA_enum_set(km->ptr, "release_confirm", 1);
                        km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
                        RNA_enum_set(km->ptr, "release_confirm", 1);
 
-                       km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
                        break;
                case SPACE_SEQ:
-                       km= WM_keymap_add_item(keymap, OP_SEQ_SLIDE, GKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_SEQ_SLIDE, GKEY, KM_PRESS, 0, 0);
 
-                       km= WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0);
+                       WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0);
 
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
                        break;
                case SPACE_IMAGE:
-                       km = WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
 
-                       km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
+                       WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
+                       WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
+                       WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
 
                        km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
                        RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap");
index 2c6870f20c04a5379650f554b4e0487bc806f52d..fb3758d2b0b17d9d6554df26b972581dd94bca66 100644 (file)
@@ -290,7 +290,7 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[],
 
 void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target) {
        ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
-       TransformOrientation *ts = transform_spaces->first;
+       TransformOrientation *ts;
        int i;
        
        for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
@@ -341,7 +341,7 @@ void BIF_removeTransformOrientationIndex(bContext *C, int index) {
 void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target) {
        ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
        View3D *v3d = CTX_wm_view3d(C);
-       TransformOrientation *ts = transform_spaces->first;
+       TransformOrientation *ts;
        int i;
        
        for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
index fc217411386f7ecfb1803d6ed6d4f5a580b6add7..98c71407631e4fc2eb92e035aaac1dd2fc363894 100644 (file)
@@ -426,7 +426,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        DerivedMesh *finaldm, *cagedm;
        unsigned char col1[4], col2[4];
        float pointsize;
-       int drawfaces, interpedges, lastsel, sel;
+       int drawfaces, interpedges;
        Image *ima= sima->image;
        
        em= BKE_mesh_get_editmesh(me);
@@ -627,8 +627,8 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        glColor4ubv((unsigned char *)col2); 
                        
                        if(me->drawflag & ME_DRAWEDGES) {
+                               int lastsel= 0, sel;
                                UI_GetThemeColor4ubv(TH_VERTEX_SELECT, col1);
-                               lastsel = sel = 0;
 
                                if(interpedges) {
                                        glShadeModel(GL_SMOOTH);
index 1ea1143202503767fc5ac90c6c39cb73fd734cd9..9e2c32765d2d82bc23aa0f2794d85f3a9ac1dcc0 100644 (file)
@@ -228,13 +228,9 @@ static void imb_float_from_rect_linear(struct ImBuf *ibuf, float *fbuf)
 void IMB_float_from_rect(struct ImBuf *ibuf)
 {
        /* quick method to convert byte to floatbuf */
-       float *tof = ibuf->rect_float;
-
-       unsigned char *to = (unsigned char *) ibuf->rect;
-       if(to==NULL) return;
-       if(tof==NULL) {
+       if(ibuf->rect==NULL) return;
+       if(ibuf->rect_float==NULL) {
                if (imb_addrectfloatImBuf(ibuf) == 0) return;
-               tof = ibuf->rect_float;
        }
        
        /* Float bufs should be stored linear */
index 4ec6e82a7dd517d0a79c93f9975f097e1ce3cffb..2edfee7e6e458c35f3b82ae2839d8d8422c24dfc 100644 (file)
@@ -85,7 +85,7 @@ static void deformVerts(ModifierData *md, Object *ob,
                                                int UNUSED(isFinalCalc))
 {
        SmokeModifierData *smd = (SmokeModifierData*) md;
-       DerivedMesh *dm = dm= get_cddm(ob, NULL, derivedData, vertexCos);
+       DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos);
 
        smokeModifier_do(smd, md->scene, ob, dm);
 
index 0b88f0f42bf621f754fb742edb512918ca711992..31cb3172013232a62c99e237caa405035913393d 100644 (file)
@@ -118,7 +118,7 @@ static void write_history(void);
 */
 static void wm_window_match_init(bContext *C, ListBase *wmlist)
 {
-       wmWindowManager *wm= G.main->wm.first;
+       wmWindowManager *wm;
        wmWindow *win, *active_win;
        
        *wmlist= G.main->wm;
index 3c27a71537b061f421c51297b91ada46404641c2..0398f44a8c9afbb49a1a971eb72e3d9c0df7da54 100644 (file)
@@ -277,7 +277,6 @@ static void wm_gesture_draw_lasso(wmGesture *gt)
        glColor3ub(96, 96, 96);
        glLineStipple(1, 0xAAAA);
        glBegin(GL_LINE_STRIP);
-       lasso= (short *)gt->customdata;
        for(i=0; i<gt->points; i++, lasso+=2)
                glVertex2sv(lasso);
        if(gt->type==WM_GESTURE_LASSO)