remove assignments which are unused.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 6 Jan 2011 01:29:13 +0000 (01:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 6 Jan 2011 01:29:13 +0000 (01:29 +0000)
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenloader/intern/readblenentry.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/editcurve.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_ops.c
source/blender/nodes/intern/CMP_nodes/CMP_texture.c
source/blender/render/intern/source/texture.c

index 612d0d4fe38d703ca7b359b53f23ab71bf9aff74..8c32733dd66d8a9daf47e1b95c288721dff4f084 100644 (file)
@@ -625,7 +625,6 @@ void shadeDispList(Scene *scene, Base *base)
        Object *ob= base->object;
        DispList *dl, *dlob;
        Material *ma = NULL;
-       Curve *cu;
        Render *re;
        float imat[3][3], mat[4][4], vec[3];
        float *fp, *nor, n1[3];
@@ -659,7 +658,6 @@ void shadeDispList(Scene *scene, Base *base)
                if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
                
                        /* now we need the normals */
-                       cu= ob->data;
                        dl= ob->disp.first;
                        
                        while(dl) {
index b8e8508da26f471adb5057f0f6658cc28ae0bb11..c886c252d61721601eed6cd4f36af60fb594a1c6 100644 (file)
@@ -115,7 +115,7 @@ static int ptcache_file_read(PTCacheFile *pf, void *f, size_t tot, size_t size);
 /* Common functions */
 static int ptcache_basic_header_read(PTCacheFile *pf)
 {
-       uint32_t totpoint, data_types;
+       uint32_t totpoint, data_types= 0;
        int error=0;
 
        /* Custom functions should read these basic elements too! */
index 673d8113f32beb85bc9b520f3c26bb72fc0de995..605f3ad785ed073fee1b2c9210eaccaf584d9752 100644 (file)
@@ -827,7 +827,7 @@ int isect_sweeping_sphere_tri_v3(float p1[3], float p2[3], float radius, float v
        sub_v3_v3v3(bv,v0,p1);
        elen2 = dot_v3v3(e1,e1);
        edotv = dot_v3v3(e1,vel);
-       edotbv = dot_v3v3(e1,bv);
+       /* edotbv = dot_v3v3(e1,bv); */ /* UNUSED */
 
        sub_v3_v3v3(bv,v1,p1);
        elen2 = dot_v3v3(e3,e3);
@@ -972,7 +972,6 @@ int isect_line_line_strict_v3(float v1[3], float v2[3], float v3[3], float v4[3]
 {
        float a[3], b[3], c[3], ab[3], cb[3], ca[3], dir1[3], dir2[3];
        float d;
-       float d1;
        
        sub_v3_v3v3(c, v3, v1);
        sub_v3_v3v3(a, v2, v1);
@@ -985,8 +984,6 @@ int isect_line_line_strict_v3(float v1[3], float v2[3], float v3[3], float v4[3]
                /* colinear or one vector is zero-length*/
                return 0;
        }
-       
-       d1 = d;
 
        cross_v3_v3v3(ab, a, b);
        d = dot_v3v3(c, ab);
index 87ff98eef1d12ac5d898d7dd753ed669385ef70e..8b16e11f25e1db4da049bbaee4962c97a0bba6bf 100644 (file)
@@ -169,11 +169,11 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype)
                                        memcpy(new_prv, prv, sizeof(PreviewImage));
                                        if (prv->rect[0]) {
                                                unsigned int *rect = NULL;
-                                               int rectlen = 0;
+                                               // int rectlen = 0;
                                                new_prv->rect[0] = MEM_callocN(new_prv->w[0]*new_prv->h[0]*sizeof(unsigned int), "prvrect");
                                                bhead= blo_nextbhead(fd, bhead);
                                                rect = (unsigned int*)(bhead+1);
-                                               rectlen = new_prv->w[0]*new_prv->h[0]*sizeof(unsigned int);
+                                               // rectlen = new_prv->w[0]*new_prv->h[0]*sizeof(unsigned int);
                                                memcpy(new_prv->rect[0], rect, bhead->len);                                     
                                        } else {
                                                new_prv->rect[0] = NULL;
@@ -181,11 +181,11 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype)
                                        
                                        if (prv->rect[1]) {
                                                unsigned int *rect = NULL;
-                                               int rectlen = 0;
+                                               // int rectlen = 0;
                                                new_prv->rect[1] = MEM_callocN(new_prv->w[1]*new_prv->h[1]*sizeof(unsigned int), "prvrect");
                                                bhead= blo_nextbhead(fd, bhead);
                                                rect = (unsigned int*)(bhead+1);
-                                               rectlen = new_prv->w[1]*new_prv->h[1]*sizeof(unsigned int);                                     
+                                               // rectlen = new_prv->w[1]*new_prv->h[1]*sizeof(unsigned int);
                                                memcpy(new_prv->rect[1], rect, bhead->len);                                                     
                                        } else {
                                                new_prv->rect[1] = NULL;
index bea7155291bb173c90044b4be9fa2657121675ac..21431bb40b5c89ac7f771478f6c7fe37d972da56 100644 (file)
@@ -791,7 +791,7 @@ void pose_copy_menu(Scene *scene)
        } 
        else { /* constraints, optional (note: max we can have is 24 constraints) */
                bConstraint *con, *con_back;
-               int const_toggle[24];
+               int const_toggle[24]= {0}; /* XXX, initialize as 0 to quiet errors */
                ListBase const_copy = {NULL, NULL};
                
                BLI_duplicatelist(&const_copy, &(pchanact->constraints));
index 5dbff672db9069ebc591017343f0899fc5151d4a..93cf02c4cb1e28596a418602a076f17a882926c7 100644 (file)
@@ -5710,11 +5710,10 @@ static int delete_exec(bContext *C, wmOperator *op)
        }
        else if(type==1) {      /* erase segment */
                /* find the 2 selected points */
-               bezt1= bezt2= 0;
-               bp1= bp2= 0;
-               nu= nubase->first;
-               nu1= 0;
-               while(nu) {
+               bezt1= bezt2= NULL;
+               bp1= bp2= NULL;
+               nu1= NULL;
+               for(nu= nubase->first; nu; nu= nu->next) {
                        next= nu->next;
                        if(nu->type == CU_BEZIER) {
                                bezt= nu->bezt;
@@ -5770,8 +5769,6 @@ static int delete_exec(bContext *C, wmOperator *op)
                                }
                        }
                        if(nu1) break;
-
-                       nu= nu->next;
                }
                if(nu1) {
                        if(bezt1) {
index dbe3697c76a8fcc505fd49b628a134dc5aeefbae..2f7e0beeba6fb19df4e2662e65c16968ceee96ba 100644 (file)
@@ -56,19 +56,11 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
 
        switch(RNA_property_type(prop)) {
                case PROP_BOOLEAN: {
-                       int value, length;
 
                        if(arraylen && index == -1)
                                return NULL;
-
-                       length= RNA_property_array_length(ptr, prop);
-
-                       if(length)
-                               value= RNA_property_boolean_get_index(ptr, prop, index);
-                       else
-                               value= RNA_property_boolean_get(ptr, prop);
                        
-                       if(icon && name && strcmp(name, "") == 0)
+                       if(icon && name && name[0] == '\0')
                                but= uiDefIconButR(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
                        else if(icon)
                                but= uiDefIconTextButR(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
index 371b2f7e5940dd5aaaeca3d72c96a1d842bcc9e5..f682da5f179b68def39b8172d42169bbb2441157 100644 (file)
@@ -1050,7 +1050,7 @@ static TextLine *first_visible_line(SpaceText *st, ARegion *ar, int *wrap_top)
                        }
                }
        } else {
-               for(i=st->top, pline= text->lines.first; pline->next && i>0; i--)
+               for(i=st->top; pline->next && i>0; i--)
                        pline= pline->next;
        }
 
@@ -1284,7 +1284,7 @@ static void draw_documentation(SpaceText *st, ARegion *ar)
 {
        TextLine *tmp;
        char *docs, buf[DOC_WIDTH+1], *p;
-       int len, i, br, lines;
+       int i, br, lines;
        int boxw, boxh, l, x, y, top;
        
        if(!st || !st->text) return;
@@ -1309,7 +1309,6 @@ static void draw_documentation(SpaceText *st, ARegion *ar)
        }
 
        top= y= ar->winy - st->lheight*l - 2;
-       len= strlen(docs);
        boxw= DOC_WIDTH*st->cwidth + 20;
        boxh= (DOC_HEIGHT+1)*st->lheight;
 
index e3ac59861bf9e021b276dd8e140f49dee792a3e2..03d806f446c2848c72b19eb142b0a22e3619d5b5 100644 (file)
@@ -1344,16 +1344,17 @@ static EnumPropertyItem move_type_items[]= {
 /* get cursor position in line by relative wrapped line and column positions */
 static int text_get_cursor_rel(SpaceText* st, ARegion *ar, TextLine *linein, int rell, int relc)
 {
-       int i, j, start, end, chars, max, chop, curs, loop, endj, found, selc;
+       int i, j, start, end, max, chop, curs, loop, endj, found, selc;
        char ch;
 
        max= wrap_width(st, ar);
 
-       selc= start= chars= endj= curs= found= 0;
+       selc= start= endj= curs= found= 0;
        end= max;
        chop= loop= 1;
 
        for(i=0, j=0; loop; j++) {
+               int chars;
                /* Mimic replacement of tabs */
                ch= linein->line[j];
                if(ch=='\t') {
@@ -1509,7 +1510,7 @@ static void wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
        Text *text= st->text;
        TextLine **linep;
        int *charp;
-       int oldl, oldc, i, j, max, start, end, chars, endj, chop, loop;
+       int oldl, oldc, i, j, max, start, end, endj, chop, loop;
        char ch;
 
        text_update_character_width(st);
@@ -1522,12 +1523,13 @@ static void wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
 
        max= wrap_width(st, ar);
 
-       start= chars= endj= 0;
+       start= endj= 0;
        end= max;
        chop= loop= 1;
        *charp= 0;
 
        for(i=0, j=0; loop; j++) {
+               int chars;
                /* Mimic replacement of tabs */
                ch= (*linep)->line[j];
                if(ch=='\t') {
@@ -1576,7 +1578,7 @@ static void wrap_move_eol(SpaceText *st, ARegion *ar, short sel)
        Text *text= st->text;
        TextLine **linep;
        int *charp;
-       int oldl, oldc, i, j, max, start, end, chars, endj, chop, loop;
+       int oldl, oldc, i, j, max, start, end, endj, chop, loop;
        char ch;
 
        text_update_character_width(st);
@@ -1589,12 +1591,13 @@ static void wrap_move_eol(SpaceText *st, ARegion *ar, short sel)
 
        max= wrap_width(st, ar);
 
-       start= chars= endj= 0;
+       start= endj= 0;
        end= max;
        chop= loop= 1;
        *charp= 0;
 
        for(i=0, j=0; loop; j++) {
+               int chars;
                /* Mimic replacement of tabs */
                ch= (*linep)->line[j];
                if(ch=='\t') {
@@ -2241,7 +2244,7 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel)
        x = (x/st->cwidth) + st->left;
        
        if(st->wordwrap) {
-               int i, j, endj, curs, max, chop, start, end, chars, loop, found;
+               int i, j, endj, curs, max, chop, start, end, loop, found;
                char ch;
 
                /* Point to first visible line */
@@ -2267,10 +2270,10 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel)
                        start= 0;
                        end= max;
                        chop= 1;
-                       chars= 0;
                        curs= 0;
                        endj= 0;
                        for(i=0, j=0; loop; j++) {
+                               int chars;
 
                                /* Mimic replacement of tabs */
                                ch= (*linep)->line[j];
index 77c71ad7e3a36e3cce7fd63d5d18f34a84f5c3b8..b6335d6afe7f038be677f7dabb24a70ceed2c544 100644 (file)
@@ -90,15 +90,15 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
        /* outputs: value, color, normal */
        
        if(node->id) {
-               RenderData *rd= data;
-               short sizex, sizey;
+               /* RenderData *rd= data; */
+               /* short sizex, sizey; */
                
                /* first make the preview image */
                CompBuf *prevbuf= alloc_compbuf(140, 140, CB_RGBA, 1); /* alloc */
 
                /* Also take care about the render size! */
-               sizex = (rd->size*rd->xsch)/100;
-               sizey = (rd->size*rd->ysch)/100;
+               /* sizex = (rd->size*rd->xsch)/100; */
+               /* sizey = (rd->size*rd->ysch)/100; */
 
                prevbuf->rect_procedural= texture_procedural;
                prevbuf->node= node;
index 684732c10d316abc7a6fb05805300f08a6a05228..0be2f1719be9ca6602d1a819473e54db853aac67 100644 (file)
@@ -1462,7 +1462,6 @@ void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg
 
        case MTEX_LIGHT:
                fact*= facg;
-               facm= 1.0-fact;
                
                col= fact*tex[0];
                if(col > out[0]) in[0]= col; else in[0]= out[0];
@@ -1565,7 +1564,6 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
                break;
 
        case MTEX_SOFT_LIGHT: 
-               col= fact*tex; 
                scf=1.0 - (1.0 - tex) * (1.0 - out); 
                in= facm*out + fact * ((1.0 - out) * tex * out) + (out * scf); 
                break;       
@@ -2364,7 +2362,6 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa
                        /* which coords */
                        if(mtex->texco==TEXCO_OBJECT) { 
                                Object *ob= mtex->object;
-                               ob= mtex->object;
                                if(ob) {                                                
                                        VECCOPY(co, xyz);       
                                        if(mtex->texflag & MTEX_OB_DUPLI_ORIG) {