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/blenlib/intern/arithb.c | 17 ++++++++++------- source/blender/blenlib/intern/bpath.c | 6 ++---- source/blender/blenlib/intern/psfont.c | 12 ++++++------ 3 files changed, 18 insertions(+), 17 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 0dda84b09fd..79517c4fde4 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2503,7 +2503,7 @@ short IsectLL2Df(float *v1, float *v2, float *v3, float *v4) 1: intersection */ -short IsectLLPt2Df(float x0,float y0,float x1,float y1, +static short IsectLLPt2Df(float x0,float y0,float x1,float y1, float x2,float y2,float x3,float y3, float *xi,float *yi) { @@ -3526,7 +3526,7 @@ int constrain_rgb(float *r, float *g, float *b) Parameter Values for the HDTV Standard for the Studio and for International Programme Exchange'', formerly CCIR Rec. 709.*/ -void gamma_correct(float *c) +static void gamma_correct(float *c) { /* Rec. 709 gamma correction. */ float cc = 0.018; @@ -3632,6 +3632,8 @@ void spheremap(float x, float y, float z, float *u, float *v) /* ------------------------------------------------------------------------- */ +/* proposed api by ton and zr, not used yet */ +#if 0 /* ***************** m1 = m2 ***************** */ void cpy_m3_m3(float m1[][3], float m2[][3]) { @@ -3655,7 +3657,6 @@ void ident_m4(float m[][4]) m[3][0]= m[3][1]= m[3][2]= 0.0; } - /* ***************** m1 = m2 (pre) * m3 (post) ***************** */ void mul_m3_m3m3(float m1[][3], float m2[][3], float m3[][3]) { @@ -3793,6 +3794,8 @@ void mul_v3_v3m4(float *v1, float *v2, float mat[][4]) } +#endif + /* moved from effect.c test if the line starting at p1 ending at p2 intersects the triangle v0..v2 return non zero if it does @@ -4240,7 +4243,7 @@ float lambda_cp_line_ex(float p[3], float l1[3], float l2[3], float cp[3]) } /* little sister we only need to know lambda */ -float lambda_cp_line(float p[3], float l1[3], float l2[3]) +static float lambda_cp_line(float p[3], float l1[3], float l2[3]) { float h[3],u[3]; VecSubf(u, l2, l1); @@ -4399,7 +4402,7 @@ void VecfCubicInterpol(float *x1, float *v1, float *x2, float *v2, float t, floa v[2]= 3*a[2]*t2 + 2*b[2]*t + v1[2]; } -int point_in_slice(float p[3], float v1[3], float l1[3], float l2[3]) +static int point_in_slice(float p[3], float v1[3], float l1[3], float l2[3]) { /* what is a slice ? @@ -4426,7 +4429,7 @@ but see a 'spat' which is a deformed cube with paired parallel planes needs only /*adult sister defining the slice planes by the origin and the normal NOTE |normal| may not be 1 but defining the thickness of the slice*/ -int point_in_slice_as(float p[3],float origin[3],float normal[3]) +static int point_in_slice_as(float p[3],float origin[3],float normal[3]) { float h,rp[3]; VecSubf(rp,p,origin); @@ -4436,7 +4439,7 @@ int point_in_slice_as(float p[3],float origin[3],float normal[3]) } /*mama (knowing the squared lenght of the normal)*/ -int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns) +static int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns) { float h,rp[3]; VecSubf(rp,p,origin); diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 898ad6ddd67..e23c2658399 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -254,7 +254,7 @@ static struct Sequence *seq_stepdata__internal(struct BPathIterator *bpi, int st return NULL; } -void seq_getpath(struct BPathIterator *bpi, char *path) { +static void seq_getpath(struct BPathIterator *bpi, char *path) { Sequence *seq = (Sequence *)bpi->data; @@ -275,7 +275,7 @@ void seq_getpath(struct BPathIterator *bpi, char *path) { } } -void seq_setpath(struct BPathIterator *bpi, char *path) { +static void seq_setpath(struct BPathIterator *bpi, char *path) { Sequence *seq = (Sequence *)bpi->data; if (seq==NULL) return; @@ -456,7 +456,6 @@ void checkMissingFiles( char *txtname ) { /* be sure there is low chance of the path being too short */ char filepath_expanded[FILE_MAXDIR*2]; - int files_missing = 0; BLI_bpathIterator_init(&bpi); while (!BLI_bpathIterator_isDone(&bpi)) { @@ -470,7 +469,6 @@ void checkMissingFiles( char *txtname ) { } } bpathToText(btxt, &bpi); - files_missing = 1; } BLI_bpathIterator_step(&bpi); } diff --git a/source/blender/blenlib/intern/psfont.c b/source/blender/blenlib/intern/psfont.c index 216246dcdd7..54d7f8ec1af 100644 --- a/source/blender/blenlib/intern/psfont.c +++ b/source/blender/blenlib/intern/psfont.c @@ -977,7 +977,7 @@ static void applymat(float mat[][2], float *x, float *y) static void setcharlist(void) { - char *name, found; + char *name; /*found;*/ int i, j; for(i=0; i