remove unused vars & avoid some clang warnings.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 14 Jan 2011 21:06:28 +0000 (21:06 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 14 Jan 2011 21:06:28 +0000 (21:06 +0000)
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/text.c
source/blender/editors/curve/editfont.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/imbuf/intern/cineon/cineon_dpx.c

index 8bb336d1c4d4cc365bf3840e47b33a640b4c54b0..71e704fe6c8d25cb22c4ec1c00e7e6417761dcf1 100644 (file)
@@ -958,14 +958,13 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
        MFace *mface = cddm->mface;
        MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE);
        float (*nors)[3] = dm->getFaceDataArray(dm, CD_NORMAL);
-       int a, b, dodraw, smoothnormal, matnr, new_matnr;
+       int a, b, dodraw, matnr, new_matnr;
        int transp, new_transp, orig_transp;
        int orig, *index = dm->getFaceDataArray(dm, CD_ORIGINDEX);
 
        cdDM_update_normals_from_pbvh(dm);
 
        matnr = -1;
-       smoothnormal = 0;
        dodraw = 0;
        transp = GPU_get_material_blend_mode();
        orig_transp = transp;
@@ -979,6 +978,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
                glBegin(GL_QUADS);
 
                for(a = 0; a < dm->numFaceData; a++, mface++) {
+                       const int smoothnormal = (mface->flag & ME_SMOOTH);
                        new_matnr = mface->mat_nr + 1;
 
                        if(new_matnr != matnr) {
@@ -1023,8 +1023,6 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
                                }
                        }
 
-                       smoothnormal = (mface->flag & ME_SMOOTH);
-
                        if(!smoothnormal) {
                                if(nors) {
                                        glNormal3fv(nors[a]);
index 9684e18b94934b4eb8d71b5072371c01b9656495..1d7ce197cbac96c39d9c2042e1da9317a4309917 100644 (file)
@@ -757,7 +757,6 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
        for (i = 0 ; i<=slen ; i++) {
        makebreak:
                // Characters in the list
-               che = vfd->characters.first;
                info = &(custrinfo[i]);
                ascii = mem[i];
                if(info->flag & CU_CHINFO_SMALLCAPS) {
@@ -1042,10 +1041,9 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
                                che= find_vfont_char(vfd, ascii);
        
                                twidth = char_width(cu, che, info);
-                               
-                               dtime= distfac*0.35f*twidth;    /* why not 0.5? */
-                               dtime= distfac*0.5f*twidth;     /* why not 0.5? */
-                               
+
+                               dtime= distfac*0.5f*twidth;
+
                                ctime= timeofs + distfac*( ct->xof - minx);
                                CLAMP(ctime, 0.0, 1.0);
 
index c837f02279b63643fa4832257e2d66dbf7809c8e..633d3aeafb91aed77933a02825263f03cd226f3c 100644 (file)
@@ -440,7 +440,6 @@ void IDP_SyncGroupValues(IDProperty *dest, IDProperty *src)
 
                                                        BLI_insertlinkafter(&dest->data.group, loop, copy);
                                                        BLI_remlink(&dest->data.group, tmp);
-                                                       loop = copy;
 
                                                        IDP_FreeProperty(tmp);
                                                        MEM_freeN(tmp);
index 2f90da2296b007339f0d0553081c34199a3759e9..36f618d04a978893ad209b5f439b9ca79c9952f1 100644 (file)
@@ -2730,8 +2730,8 @@ static struct ImBuf * do_solid_color(
 
        unsigned char *rect;
        float *rect_float;
-       int x = context.rectx;
-       int y = context.recty;
+       /*int x = context.rectx;*/ /*UNUSED*/
+       /*int y = context.recty;*/ /*UNUSED*/
 
        if (out->rect) {
                unsigned char col0[3];
index 20492b990484f84dc0fdcc3fdbd5f007ef8725c4..1bd41c7aa86ccb39a2012549f22d967a0b5a6916 100644 (file)
@@ -280,7 +280,6 @@ int reopen_text(Text *text)
        text->mtime= st.st_mtime;
        
        text->nlines=0;
-       i=0;
        llen=0;
        for(i=0; i<len; i++) {
                if (buffer[i]=='\n') {
index 70a41ae74325581741742865891cb96a368c39ef..44fec63144133eac4d9754ab9611c079e93135cf 100644 (file)
@@ -1221,7 +1221,7 @@ static int insert_text_exec(bContext *C, wmOperator *op)
        Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
        char *inserted_utf8;
-       wchar_t *inserted_text, first;
+       wchar_t *inserted_text;
        int a, len;
 
        if(!RNA_property_is_set(op->ptr, "text"))
@@ -1232,7 +1232,6 @@ static int insert_text_exec(bContext *C, wmOperator *op)
 
        inserted_text= MEM_callocN(sizeof(wchar_t)*(len+1), "FONT_insert_text");
        utf8towchar(inserted_text, inserted_utf8);
-       first= inserted_text[0];
 
        for(a=0; a<len; a++)
                insert_into_textbuf(obedit, inserted_text[a]);
index f812de692e2d4d37c02bf3a12c7ff70ba4f83a4c..3f27ee52034440e8777cada6b3e0fc603c836a26 100644 (file)
@@ -3736,7 +3736,7 @@ static void p_smooth(PChart *chart)
        int j, it2, maxiter2, it;
        int nedges = chart->nedges, nwheel, gridx, gridy;
        int edgesx, edgesy, nsize, esize, i, x, y, maxiter, totiter;
-       float minv[2], maxv[2], median, invmedian, distortion, avglen2d, avglen3d;
+       float minv[2], maxv[2], median, invmedian, avglen2d, avglen3d;
        float center[2], dx, dy, *nodes, dlimit, d, *oldnodesx, *oldnodesy;
        float *nodesx, *nodesy, *hedges, *vedges, climit, moved, padding;
        SmoothTriangle *triangles, *t, *t2, **tri, **trip;
@@ -3755,7 +3755,6 @@ static void p_smooth(PChart *chart)
        invmedian = 1.0/median;
 
        /* compute edge distortion */
-       distortion = 0.0;
        avglen2d = avglen3d = 0.0;
 
        for (e=chart->edges; e; e=e->nextlink) {
index f7ca1c5bfe0033a2ae868a3f3063469dd03b6e70..eae5ca1b4b96db40bb07b31cc65073250f8ad52e 100644 (file)
@@ -918,6 +918,8 @@ void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, int *red
 
        numfaces= dm->getNumFaces(dm);
        for( i=0; i < numfaces; i++ ) {
+               const int smoothnormal = (mface[i].flag & ME_SMOOTH);
+
                start = index[redir[mface[i].mat_nr+16383]];
                if( mface[i].v4 )
                        index[redir[mface[i].mat_nr+16383]] += 18;
@@ -925,7 +927,7 @@ void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, int *red
                        index[redir[mface[i].mat_nr+16383]] += 9;
 
                /* v1 v2 v3 */
-               if( mface[i].flag & ME_SMOOTH ) {
+               if(smoothnormal) {
                        VECCOPY(&varray[start],mvert[mface[i].v1].no);
                        VECCOPY(&varray[start+3],mvert[mface[i].v2].no);
                        VECCOPY(&varray[start+6],mvert[mface[i].v3].no);
@@ -947,7 +949,7 @@ void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, int *red
 
                if( mface[i].v4 ) {
                        /* v3 v4 v1 */
-                       if( mface[i].flag & ME_SMOOTH ) {
+                       if(smoothnormal) {
                                VECCOPY(&varray[start+9],mvert[mface[i].v3].no);
                                VECCOPY(&varray[start+12],mvert[mface[i].v4].no);
                                VECCOPY(&varray[start+15],mvert[mface[i].v1].no);
index 1395b04711301a17ff8d67e549acba782d6a1ff8..0551922b19afc68094f4beb3fa03a7bc83d49fd9 100644 (file)
@@ -126,7 +126,6 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filename, int use_cineon
        LogImageFile* logImage;
        unsigned short* line, *pixel;
        int i, j;
-       int index;
        float *fline;
        float *fbuf;
        int is_alloc= 0;
@@ -155,7 +154,6 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filename, int use_cineon
                printf("error setting args\n");
        }
 
-       index = 0;
        line = MEM_mallocN(sizeof(unsigned short)*depth*width, "line");
        
        /*note that image is flipped when sent to logImageSetRowBytes (see last passed parameter).*/