diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-08 15:43:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-08 15:43:44 +0300 |
commit | 3b74074aec8ad551f210fda9ed13cf654d98876f (patch) | |
tree | eec1e688ae024187c2d999126da5cdd61fc1b875 /source | |
parent | 988e5371fac894a6b35e561fc43e5e9ea6bc3c40 (diff) |
remove unused code & variables.
Diffstat (limited to 'source')
20 files changed, 35 insertions, 61 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index d1dcf7aa9b3..ce68df5c8b6 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -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); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index aeb1f525943..cdf2991f532 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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]); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 8cc3a3fc07a..cc54468a1de 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -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; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 1bfefef4b71..7cf6b21e2f1 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -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; } diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 9a9d67a01f8..ecaa15c8f7d 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -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; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index cc3d6a96092..03091b9b0a4 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -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; */ } } } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 45016e2db73..3534a7dba37 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -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 */ diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 2d31cf7ba46..2f90da2296b 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -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; diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 40fe71ded23..e139820be32 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -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; diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 5ae35aaa266..0b5347ca304 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -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) { diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 9d93168590f..0408d814d81 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -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; diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index fb90af873df..d25aefef543 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -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); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 456c752c302..77ef825ee34 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -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) diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 801130eebc8..96dad590fee 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -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; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 6ddd7475f33..ab53a95a156 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -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); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 53e74cc9ae0..8501ee22031 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -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; diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index a2c65bc2b08..43b2c645924 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -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') { diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 015b4b649d4..e6a3dc49668 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -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); diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index c340a472504..e1c14faa3e1 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -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; diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 1b5d390fd1a..6bdb45c3220 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -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"); |