From 2a331067cc52693aa903a0487be29c93298c4b8b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 29 Sep 2008 17:08:11 +0000 Subject: resolve some compiler warnings with intel c/c++ compiler * subsurf code had a lot of unused variables, removed these where they are obviously not needed. commented if they could be useful later. * some variables declorations hide existing variables (many of these left), but fixed some that could cause confusion. * removed unused vars * obscure python memory leak with colorband. * make_sample_tables had a loop running wasnt used. * if 0'd functions in arithb.c that are not used yet. * made many functions static --- source/blender/render/intern/source/convertblender.c | 5 +++-- source/blender/render/intern/source/initrender.c | 7 +------ source/blender/render/intern/source/occlusion.c | 4 ++-- source/blender/render/intern/source/rayshade.c | 19 +++++++------------ source/blender/render/intern/source/shadeoutput.c | 4 ++-- source/blender/render/intern/source/texture.c | 10 +++++----- 6 files changed, 20 insertions(+), 29 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 4af6bf6f543..96909ec1041 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -2442,7 +2442,8 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, VertRen *v1, *v2, *v3, *v4, *ver; VlakRen *vlr, *vlr1, *vlr2, *vlr3; Curve *cu= ob->data; - float *data, n1[3], flen; + float *data, n1[3]; + /*float flen; - as yet unused */ int u, v, orcoret= 0; int p1, p2, p3, p4, a; int sizeu, nsizeu, sizev, nsizev; @@ -2514,7 +2515,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, vlr= RE_findOrAddVlak(obr, obr->totvlak++); vlr->v1= v1; vlr->v2= v2; vlr->v3= v3; vlr->v4= v4; - flen= CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, n1); + /* flen= CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, n1); - as yet unused */ VECCOPY(vlr->n, n1); vlr->mat= matar[ dl->col]; diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index e9035f29b3c..40c0edb6e5f 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -257,7 +257,7 @@ void make_sample_tables(Render *re) { static int firsttime= 1; SampleTables *st; - float flweight[32], fmask[256]; + float flweight[32]; float weight[32], totw, val, *fpx1, *fpx2, *fpy1, *fpy2, *m3, *m4; int i, j, a; @@ -300,11 +300,6 @@ void make_sample_tables(Render *re) st->centLut[a]= -0.45+((float)a)/16.0; } - val= 1.0/((float)re->osa); - for(a=0; a<256; a++) { - fmask[a]= ((float)st->cmask[a])*val; - } - /* calculate totw */ totw= 0.0; for(j= -1; j<2; j++) { diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 15c57eb9362..d2d2cf3fb77 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -402,7 +402,7 @@ static int occ_find_bbox_axis(OcclusionTree *tree, int begin, int end, float *mi return axis; } -void occ_node_from_face(OccFace *face, OccNode *node) +static void occ_node_from_face(OccFace *face, OccNode *node) { float n[3]; @@ -1143,7 +1143,7 @@ static float occ_quad_form_factor(float *p, float *n, float *q0, float *q1, floa return result; } -float occ_form_factor(OccFace *face, float *p, float *n) +static float occ_form_factor(OccFace *face, float *p, float *n) { ObjectInstanceRen *obi; VlakRen *vlr; diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 6c4bd5da1a9..48ae84379ba 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -736,7 +736,7 @@ static void hammersley_create(double *out, int n) } } -struct QMCSampler *QMC_initSampler(int type, int tot) +static struct QMCSampler *QMC_initSampler(int type, int tot) { QMCSampler *qsa = MEM_callocN(sizeof(QMCSampler), "qmc sampler"); qsa->samp2d = MEM_callocN(2*sizeof(double)*tot, "qmc sample table"); @@ -885,7 +885,7 @@ void init_render_qmcsampler(Render *re) re->qmcsamplers= MEM_callocN(sizeof(ListBase)*BLENDER_MAX_THREADS, "QMCListBase"); } -QMCSampler *get_thread_qmcsampler(Render *re, int thread, int type, int tot) +static QMCSampler *get_thread_qmcsampler(Render *re, int thread, int type, int tot) { QMCSampler *qsa; @@ -906,7 +906,7 @@ QMCSampler *get_thread_qmcsampler(Render *re, int thread, int type, int tot) return qsa; } -void release_thread_qmcsampler(Render *re, int thread, QMCSampler *qsa) +static void release_thread_qmcsampler(Render *re, int thread, QMCSampler *qsa) { qsa->used= 0; } @@ -1176,7 +1176,6 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f /* extern call from render loop */ void ray_trace(ShadeInput *shi, ShadeResult *shr) { - VlakRen *vlr; float i, f, f1, fr, fg, fb; float mircol[4], tracol[4]; float diff[3]; @@ -1184,7 +1183,7 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr) do_tra= ((shi->mat->mode & (MA_RAYTRANSP)) && shr->alpha!=1.0f); do_mir= ((shi->mat->mode & MA_RAYMIRROR) && shi->ray_mirror!=0.0f); - vlr= shi->vlr; + /* raytrace mirror amd refract like to separate the spec color */ if(shi->combinedflag & SCE_PASS_SPEC) @@ -1527,7 +1526,7 @@ static float *sphere_sampler(int type, int resol, int thread, int xs, int ys) } } -void ray_ao_qmc(ShadeInput *shi, float *shadfac) +static void ray_ao_qmc(ShadeInput *shi, float *shadfac) { Isect isec; QMCSampler *qsa=NULL; @@ -1538,7 +1537,6 @@ void ray_ao_qmc(ShadeInput *shi, float *shadfac) float fac=0.0f, prev=0.0f; float adapt_thresh = G.scene->world->ao_adapt_thresh; float adapt_speed_fac = G.scene->world->ao_adapt_speed_fac; - float bias = G.scene->world->aobias; int samples=0; int max_samples = R.wrld.aosamp*R.wrld.aosamp; @@ -1566,13 +1564,10 @@ void ray_ao_qmc(ShadeInput *shi, float *shadfac) dxyview[2]= 0.0f; } - /* bias prevents smoothed faces to appear flat */ if(shi->vlr->flag & R_SMOOTH) { - bias= G.scene->world->aobias; VECCOPY(nrm, shi->vn); } else { - bias= 0.0f; VECCOPY(nrm, shi->facenor); } @@ -1667,7 +1662,7 @@ void ray_ao_qmc(ShadeInput *shi, float *shadfac) } /* extern call from shade_lamp_loop, ambient occlusion calculus */ -void ray_ao_spheresamp(ShadeInput *shi, float *shadfac) +static void ray_ao_spheresamp(ShadeInput *shi, float *shadfac) { Isect isec; float *vec, *nrm, div, bias, sh=0.0f; @@ -2123,7 +2118,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac) } /* only when face points away from lamp, in direction of lamp, trace ray and find first exit point */ -void ray_translucent(ShadeInput *shi, LampRen *lar, float *distfac, float *co) +static void ray_translucent(ShadeInput *shi, LampRen *lar, float *distfac, float *co) { Isect isec; float lampco[3], maxsize; diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 91621c24365..c4fac1aeb06 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1460,10 +1460,10 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr) LampRen *lar; GroupObject *go; float inpr, lv[3]; - float *vn, *view, shadfac[4]; + float *view, shadfac[4]; float ir, accum, visifac, lampdist; - vn= shi->vn; + view= shi->view; accum= ir= 0.0f; diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index c14425e274f..7ce66ff6d12 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1712,18 +1712,18 @@ void do_material_tex(ShadeInput *shi) texres.nor[2]= texres.tb; } else { - float co= 0.5*cos(texres.tin-0.5); + float co_nor= 0.5*cos(texres.tin-0.5); float si= 0.5*sin(texres.tin-0.5); float f1, f2; f1= shi->vn[0]; f2= shi->vn[1]; - texres.nor[0]= f1*co+f2*si; - texres.nor[1]= f2*co-f1*si; + texres.nor[0]= f1*co_nor+f2*si; + texres.nor[1]= f2*co_nor-f1*si; f1= shi->vn[1]; f2= shi->vn[2]; - texres.nor[1]= f1*co+f2*si; - texres.nor[2]= f2*co-f1*si; + texres.nor[1]= f1*co_nor+f2*si; + texres.nor[2]= f2*co_nor-f1*si; } } // warping, local space -- cgit v1.2.3