remove unused code & variables.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 8 Jan 2011 12:43:44 +0000 (12:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 8 Jan 2011 12:43:44 +0000 (12:43 +0000)
20 files changed:
source/blender/blenfont/intern/blf_font.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/text.c
source/blender/blenlib/intern/math_color.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/noise.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/space_console/console_ops.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/windowmanager/intern/wm_draw.c

index d1dcf7aa9b3fc14b0f034472f8cf6cf328598625..ce68df5c8b6e09446150c325ae4eba7fa4099a00 100644 (file)
@@ -159,7 +159,6 @@ void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len)
        if (!font->glyph_cache)
                return;
 
-       i= 0;
        pen_x= 0;
        pen_y= 0;
        has_kerning= FT_HAS_KERNING(font->face);
index aeb1f525943b2037e403209718079047fb20d1ad..cdf2991f5323721f6a3b5879eea13f5df5c8eb74 100644 (file)
@@ -2602,15 +2602,8 @@ void DM_add_tangent_layer(DerivedMesh *dm)
        /* write tangent to layer */
        for(i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++, tangent+=4) {
                len= (mf->v4)? 4 : 3; 
-               
-               if(mtface) {
-                       uv1= tf->uv[0];
-                       uv2= tf->uv[1];
-                       uv3= tf->uv[2];
-                       uv4= tf->uv[3];
-               }
-               else {
-                       uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
+
+               if(mtface == NULL) {
                        map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
                        map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
                        map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
index 8cc3a3fc07add1e4976b35f1711523ef5168163a..cc54468a1de10b69fe8a6f3508484a948766a363 100644 (file)
@@ -431,7 +431,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
        PointCache *cache;
        PTCacheID pid;
        float timescale;
-       int framedelta, framenr, startframe, endframe;
+       int framenr, startframe, endframe;
        int cache_result;
 
        clmd->scene= scene;     /* nice to pass on later :) */
@@ -487,11 +487,6 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
                framenr= endframe;
        }
 
-       if(cache->flag & PTCACHE_SIMULATION_VALID)
-               framedelta= framenr - cache->simframe;
-       else
-               framedelta= -1;
-
        /* initialize simulation data if it didn't exist already */
        if(!do_init_cloth(ob, clmd, dm, framenr))
                return result;
index 1bfefef4b71f2b830e6a713ffdddf1ca4ced8bb8..7cf6b21e2f19e550bab4478f32dafdb214d3f09a 100644 (file)
@@ -1012,6 +1012,9 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
        int savedlines, saveline;
        float rgb[3], ycc[3], luma;
        int ycc_mode=-1;
+       const short is_float = (ibuf->rect_float != NULL);
+
+       if (ibuf->rect==NULL && ibuf->rect_float==NULL) return;
 
        if (scopes->ok == 1 ) return;
 
@@ -1019,6 +1022,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
 
        /* hmmmm */
        if (!(ELEM(ibuf->channels, 3, 4))) return;
+
        scopes->hist.channels = 3;
        scopes->hist.x_resolution = 256;
 
@@ -1073,9 +1077,9 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
        scopes->waveform_3= MEM_callocN(scopes->waveform_tot * 2 * sizeof(float), "waveform point channel 3");
        scopes->vecscope= MEM_callocN(scopes->waveform_tot * 2 * sizeof(float), "vectorscope point channel");
        
-       if (ibuf->rect_float)
+       if (is_float)
                rf = ibuf->rect_float;
-       else if (ibuf->rect)
+       else
                rc = (unsigned char *)ibuf->rect;
 
        for (y = 0; y < ibuf->y; y++) {
@@ -1084,13 +1088,13 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
                } else saveline=0;
                for (x = 0; x < ibuf->x; x++) {
 
-                       if (ibuf->rect_float) {
+                       if (is_float) {
                                if (use_color_management)
                                        linearrgb_to_srgb_v3_v3(rgb, rf);
                                else
                                        copy_v3_v3(rgb, rf);
                        }
-                       else if (ibuf->rect) {
+                       else {
                                for (c=0; c<3; c++)
                                        rgb[c] = rc[c] * INV_255;
                        }
index 9a9d67a01f8dddfd72261ae834d9f48cd4fb8e54..ecaa15c8f7da65929ed09e3657fa40ebc2c954a3 100644 (file)
@@ -859,12 +859,15 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
                                yof= cu->yof + tb->y/cu->fsize;
                        }
 
+                       /* XXX, has been unused for years, need to check if this is useful, r4613 r5282 - campbell */
+#if 0
                        if(ascii == '\n' || ascii == '\r')
                                xof = cu->xof;
                        else
                                xof= cu->xof + (tb->x/cu->fsize);
-
+#else
                        xof= cu->xof + (tb->x/cu->fsize);
+#endif
                        lnr++;
                        cnr= 0;
                        wsnr= 0;
index cc3d6a9609261a46332fed510960dee3f8eb4e17..03091b9b0a4fdbe219cdb1256fc61e0689d3564c 100644 (file)
@@ -149,14 +149,14 @@ ModifierData *modifiers_findByName(Object *ob, const char *name)
 void modifiers_clearErrors(Object *ob)
 {
        ModifierData *md = ob->modifiers.first;
-       int qRedraw = 0;
+       /* int qRedraw = 0; */
 
        for (; md; md=md->next) {
                if (md->error) {
                        MEM_freeN(md->error);
                        md->error = NULL;
 
-                       qRedraw = 1;
+                       /* qRedraw = 1; */
                }
        }
 }
index 45016e2db734257b99718fe886e8ebaff5e98e8c..3534a7dba374916316c945994cc65f0e90e65f00 100644 (file)
@@ -3488,7 +3488,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
        ParticleSystem *psys = sim->psys;
        ParticleSettings *part = psys->part;
        PARTICLE_P;
-       float disp, birthtime, dietime;
+       float disp, dietime;
 
        BLI_srandom(psys->seed);
 
@@ -3503,7 +3503,6 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
 
                psys->lattice= psys_get_lattice(sim);
 
-               birthtime = pa->time;
                dietime = pa->dietime;
 
                /* update alive status and push events */
index 2d31cf7ba464b34efc3482c7134c606bffb1db9a..2f90da2296b007339f0d0553081c34199a3759e9 100644 (file)
@@ -1592,15 +1592,10 @@ static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo
 // This function calculates the blur band for the wipe effects
 static float in_band(WipeZone *wipezone,float width,float dist,float perc,int side,int dir)
 {
-       float t1,t2,alpha,percwidth;
+       float t1,t2,alpha;
 
        if(width == 0)
                return (float)side;
-
-       if(side == 1)
-               percwidth = width * perc;
-       else
-               percwidth = width * (1 - perc);
        
        if(width < dist)
                return side;
index 40fe71ded232e75fd2da2d95c84a0990dec0e090..e139820be320296ac8664f24a25c4ac384c55069 100644 (file)
@@ -1373,7 +1373,6 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v
        ccgdm_pbvh_update(ccgdm);
 
        doDraw = 0;
-       numVerts = 0;
        matnr = -1;
        transp = GPU_get_material_blend_mode();
        orig_transp = transp;
index 5ae35aaa26657d1e987dc2fddf7c982f69ee6d05..0b5347ca304efab04b4e6d1159a391d517f4e68f 100644 (file)
@@ -1233,7 +1233,7 @@ int txt_find_string(Text *text, char *findstr, int wrap)
 {
        TextLine *tl, *startl;
        char *s= NULL;
-       int oldcl, oldsl, oldcc, oldsc;
+       int oldcl, oldsl;
 
        if (!text || !text->curl || !text->sell) return 0;
        
@@ -1242,8 +1242,6 @@ int txt_find_string(Text *text, char *findstr, int wrap)
        oldcl= txt_get_span(text->lines.first, text->curl);
        oldsl= txt_get_span(text->lines.first, text->sell);
        tl= startl= text->sell;
-       oldcc= text->curc;
-       oldsc= text->selc;
        
        s= strstr(&tl->line[text->selc], findstr);
        while (!s) {
index 9d93168590f405989d95a06bfc90eb6ce26e9b31..0408d814d818c6377c1b1cf6cde33581cdd59046 100644 (file)
@@ -209,7 +209,6 @@ void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv)
                s = (cmax - cmin)/cmax;
        else {
                s = 0.0f;
-               h = 0.0f;
        }
        if (s == 0.0f)
                h = -1.0f;
index fb90af873dff0db1bb52db365d370be43564ec64..d25aefef5438a29d90c766b1b6f0653cf577aeec 100644 (file)
@@ -662,7 +662,7 @@ int isect_sweeping_sphere_tri_v3(float p1[3], float p2[3], float radius, float v
 {
        float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], temp[3], bv[3];
        float a, b, c, d, e, x, y, z, radius2=radius*radius;
-       float elen2,edotv,edotbv,nordotv,vel2;
+       float elen2,edotv,edotbv,nordotv;
        float newLambda;
        int found_by_sweep=0;
 
@@ -736,7 +736,7 @@ int isect_sweeping_sphere_tri_v3(float p1[3], float p2[3], float radius, float v
        *lambda=1.0f;
 
 /*---test points---*/
-       a=vel2=dot_v3v3(vel,vel);
+       a=dot_v3v3(vel,vel);
 
        /*v0*/
        sub_v3_v3v3(temp,p1,v0);
@@ -825,9 +825,9 @@ int isect_sweeping_sphere_tri_v3(float p1[3], float p2[3], float radius, float v
        }
 
        /*e3*/
-       sub_v3_v3v3(bv,v0,p1);
-       elen2 = dot_v3v3(e1,e1);
-       edotv = dot_v3v3(e1,vel);
+       /* sub_v3_v3v3(bv,v0,p1); */ /* UNUSED */
+       /* elen2 = dot_v3v3(e1,e1); */ /* UNUSED */
+       /* edotv = dot_v3v3(e1,vel); */ /* UNUSED */
        /* edotbv = dot_v3v3(e1,bv); */ /* UNUSED */
 
        sub_v3_v3v3(bv,v1,p1);
index 456c752c30280052792a3544af2db8592b1771e6..77ef825ee3425ea533fff5af996c18081abdccd1 100644 (file)
@@ -1457,7 +1457,6 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
        eps = powf(2.0f,-52.0f);
        while (p > 0) {
                int kase=0;
-               k=0;
 
                // Test for maximum iterations to avoid infinite loop
                if(maxiter == 0)
index 801130eebc8454f9f490217e4cd3c0a1e312f306..96dad590fee89c737ac48543289cac593e8ebb0b 100644 (file)
@@ -1756,7 +1756,7 @@ float mg_RidgedMultiFractal(float x, float y, float z, float H, float lacunarity
        signal = offset - fabs(noisefunc(x, y, z));
        signal *= signal;
        result = signal;
-       weight = 1.f;
+
 
        for( i=1; i<(int)octaves; i++ ) {
                x *= lacunarity;
index 6ddd7475f332d744068c9b786e164def3aacd013..ab53a95a1560d0f76e126e72789eb01b71845017 100644 (file)
@@ -280,10 +280,9 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt)
        else if (ob->id.lib) {
                uiPopupMenu *pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION);
                uiLayout *layout= uiPupMenuLayout(pup);
-               PointerRNA props_ptr;
                
                /* create operator menu item with relevant properties filled in */
-               props_ptr= uiItemFullO(layout, op->idname, op->type->name, ICON_NULL, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+               uiItemFullO(layout, op->idname, op->type->name, ICON_NULL, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
                
                /* present the menu and be done... */
                uiPupMenuEnd(C, pup);
index 53e74cc9ae046405ab7221bc6be01b760c5403db..8501ee22031895342bf193ff34bfc9f10e2dbd99 100644 (file)
@@ -1366,7 +1366,6 @@ static void vgroup_assign_verts(Object *ob, float weight)
                        dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
 
                        if(dvert && (eve->f & SELECT)){
-                               done=0;
                                /* See if this vert already has a reference to this group */
                                /*              If so: Change its weight */
                                done=0;
index a2c65bc2b08530550bb423eed9075a2e1a5c0324..43b2c6459248fa0e7c864f076d9a5c11b3231ebe 100644 (file)
@@ -658,12 +658,11 @@ static int scrollback_append_exec(bContext *C, wmOperator *op)
 {
        SpaceConsole *sc= CTX_wm_space_console(C);
        ARegion *ar= CTX_wm_region(C);
-
-       ConsoleLine *ci= console_history_verify(C);
+       ConsoleLine *ci;
        
        char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, dont free */
        int type= RNA_enum_get(op->ptr, "type");
-       
+
        ci= console_scrollback_add_str(sc, str, 1); /* own the string */
        ci->type= type;
        
@@ -703,7 +702,6 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
 static int copy_exec(bContext *C, wmOperator *UNUSED(op))
 {
        SpaceConsole *sc= CTX_wm_space_console(C);
-       int buf_len;
 
        DynStr *buf_dyn= BLI_dynstr_new();
        char *buf_str;
@@ -756,7 +754,7 @@ static int copy_exec(bContext *C, wmOperator *UNUSED(op))
        }
 
        buf_str= BLI_dynstr_get_cstring(buf_dyn);
-       buf_len= BLI_dynstr_get_len(buf_dyn);
+
        BLI_dynstr_free(buf_dyn);
        WM_clipboard_text_set(buf_str, 0);
 
@@ -793,7 +791,6 @@ static int paste_exec(bContext *C, wmOperator *UNUSED(op))
        if(buf_str==NULL)
                return OPERATOR_CANCELLED;
 
-       buf_next= buf_str;
        buf_step= buf_str;
 
        while((buf_next=buf_step) && buf_next[0] != '\0') {
index 015b4b649d403f3c0be94552abb8d9fb56e358d9..e6a3dc496681d05fcc2456bbaff417926ec4f5e6 100644 (file)
@@ -198,7 +198,7 @@ static DerivedMesh * splitEdges(ExplodeModifierData *emd, DerivedMesh *dm){
        int *facesplit = MEM_callocN(sizeof(int)*totface,"explode_facesplit");
        int *vertpa = MEM_callocN(sizeof(int)*totvert,"explode_vertpa2");
        int *facepa = emd->facepa;
-       int *fs, totesplit=0,totfsplit=0,totin=0,curdupvert=0,curdupface=0,curdupin=0;
+       int *fs, totesplit=0,totfsplit=0,totin=0,curdupface=0,curdupin=0;
        int i,j,v1,v2,v3,v4,esplit;
 
        edgehash= BLI_edgehash_new();
@@ -314,7 +314,6 @@ static DerivedMesh * splitEdges(ExplodeModifierData *emd, DerivedMesh *dm){
        emd->facepa=facepa;
 
        /* create new verts */
-       curdupvert=totvert;
        ehi= BLI_edgehashIterator_new(edgehash);
        for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
                BLI_edgehashIterator_getKey(ehi, &i, &j);
@@ -671,7 +670,8 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
        EdgeHashIterator *ehi;
        float *vertco=0, imat[4][4];
        float loc0[3], nor[3];
-       float timestep, cfra;
+       float cfra;
+       /* float timestep; */
        int *facepa=emd->facepa;
        int totdup=0,totvert=0,totface=0,totpart=0;
        int i, j, v, mindex=0;
@@ -686,7 +686,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
        sim.psys= psmd->psys;
        sim.psmd= psmd;
 
-       timestep= psys_get_timestep(&sim);
+       /* timestep= psys_get_timestep(&sim); */
 
        //if(part->flag & PART_GLOB_TIME)
                cfra= BKE_curframe(scene);
index c340a4725040614af8d35cc383d49b41faacfef0..e1c14faa3e193e8e7fb7f005a77a34fad4724876 100644 (file)
@@ -143,7 +143,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        int step;
        int i, j;
        int i1,i2;
-       int step_tot= ltmd->steps;
+       int step_tot= useRenderParams ? ltmd->render_steps : ltmd->steps;
        const int do_flip = ltmd->flag & MOD_SCREW_NORMAL_FLIP ? 1 : 0;
        int maxVerts=0, maxEdges=0, maxFaces=0;
        int totvert= dm->getNumVerts(dm);
@@ -173,8 +173,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        if (!totvert)
                return CDDM_from_template(dm, 0, 0, 0);
 
-       step_tot= useRenderParams ? ltmd->render_steps : ltmd->steps;
-
        switch(ltmd->axis) {
        case 0:
                other_axis_1=1;
index 1b5d390fd1a43f403d4c77cf472973a8e1bffaf3..6bdb45c32204e9b86b0cb644151068fc60b30b4d 100644 (file)
@@ -569,8 +569,6 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
                wmSubWindowSet(win, screen->mainwin);
 
                wm_triple_draw_textures(win, win->drawdata);
-
-               triple= win->drawdata;
        }
        else {
                win->drawdata= MEM_callocN(sizeof(wmDrawTriple), "wmDrawTriple");