remove some redundant vars, assignments & checks.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 19 Mar 2011 05:06:06 +0000 (05:06 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 19 Mar 2011 05:06:06 +0000 (05:06 +0000)
13 files changed:
intern/mikktspace/mikktspace.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/text.c
source/blender/editors/armature/poselib.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/render/render_shading.c
source/blender/editors/space_view3d/drawobject.c
source/blender/imbuf/intern/cineon/cineonlib.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/windowmanager/intern/wm_init_exit.c

index 0c7f76e1269b89b9c510dfdc8f20d78e3705318a..8ccb19e35e6541f290593e68b1ea6ca8b16517b1 100644 (file)
@@ -282,7 +282,6 @@ tbool genTangSpace(const SMikkTSpaceContext * pContext, const float fAngularThre
 
        // Mark all degenerate triangles
        iTotTris = iNrTrianglesIn;
-       iNrTrianglesIn = 0;
        iDegenTriangles = 0;
        for(t=0; t<iTotTris; t++)
        {
index 1c11e3010a336cd454a995cd9be7118ed7ff4a49..105c357906f8150c5993c0544e067b9fa9c0d1e7 100644 (file)
@@ -1712,13 +1712,12 @@ static void bevel_list_flip_tangents(BevList *bl)
 /* apply user tilt */
 static void bevel_list_apply_tilt(BevList *bl)
 {
-       BevPoint *bevp2, *bevp1, *bevp0;
+       BevPoint *bevp2, *bevp1;
        int nr;
        float q[4];
 
        bevp2= (BevPoint *)(bl+1);
        bevp1= bevp2+(bl->nr-1);
-       bevp0= bevp1-1;
 
        nr= bl->nr;
        while(nr--) {
@@ -1726,7 +1725,6 @@ static void bevel_list_apply_tilt(BevList *bl)
                mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
                normalize_qt(bevp1->quat);
 
-               bevp0= bevp1;
                bevp1= bevp2;
                bevp2++;
        }
index b4d6cf886ec5d55265062c8bdea62e4bc25131fc..f5f069767eb4666c0fca282dcbc5b47166e4371f 100644 (file)
@@ -507,7 +507,7 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
        }
 
        /* Initialize the destination */
-       out = disps = MEM_callocN(3*d->totdisp*sizeof(float), "iterp disps");
+       disps = MEM_callocN(3*d->totdisp*sizeof(float), "iterp disps");
 
        side = sqrt(d->totdisp / dst_corners);
        st = (side<<1)-1;
index a4a892a75bbafd4b3ece03944b893442d68c1d72..ec75bfb18184e84a7abc1a26449c2775ec9d6fa5 100644 (file)
@@ -1556,10 +1556,9 @@ void graph_print_queue(DagNodeQueue *nqueue)
 void graph_print_queue_dist(DagNodeQueue *nqueue)
 {      
        DagNodeQueueElem *queueElem;
-       int max, count;
+       int count;
        
        queueElem = nqueue->first;
-       max = queueElem->node->DFS_fntm;
        count = 0;
        while(queueElem) {
                fprintf(stderr,"** %25s %2.2i-%2.2i ",((ID *) queueElem->node->ob)->name,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
index 36c82a3c6fc53b1cb01b5c57c1ba37a6e2603dad..bebfcaed78fa4b9071f8864b84fbac266053ad2b 100644 (file)
@@ -2204,7 +2204,6 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
        /*      Blancmange (bmange@airdmhor.gen.nz) */
 
        k = -1.0/(2.0*3.14159*blur*blur);
-       fval=0;
        for (ix = 0;ix< halfWidth;ix++){
                weight = (float)exp(k*(ix*ix));
                filter[halfWidth - ix] = weight;
index a8709163c7b2d2354525e5ea1829da9790e23754..376f3fb031f47a7cdd6004ce14f9ccfe151f917f 100644 (file)
@@ -378,7 +378,6 @@ Text *add_text(const char *file, const char *relpath)
        ta->mtime= st.st_mtime;
        
        ta->nlines=0;
-       i=0;
        llen=0;
        for(i=0; i<len; i++) {
                if (buffer[i]=='\n') {
index 21e11d7a83033b5f6d944b5b8e0c4b3dc6181ce0..5fc872d070d79596fc72229e81f3a02fcd2d0906 100644 (file)
@@ -354,7 +354,7 @@ void POSELIB_OT_action_sanitise (wmOperatorType *ot)
 static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *UNUSED(arg))
 {
        Object *ob= get_poselib_object(C);
-       bAction *act= (ob) ? ob->poselib : NULL;
+       bAction *act= ob->poselib; /* never NULL */
        TimeMarker *marker;
        
        /* set the operator execution context correctly */
index f5061dbf0af6089801e10847214cc86a32ccfb45..1e94824a9f9e0b29c9a2874c6fe0c2a7be3282a2 100644 (file)
@@ -1971,17 +1971,15 @@ static void ui_litem_layout_split(uiLayout *litem)
        uiLayoutItemSplt *split= (uiLayoutItemSplt*)litem;
        uiItem *item;
        float percentage;
-       int itemh, x, y, w, tot=0, colw=0;
+       const int tot= BLI_countlist(&litem->items);
+       int itemh, x, y, w, colw=0;
+
+       if(tot == 0)
+               return;
 
        x= litem->x;
        y= litem->y;
 
-       for(item=litem->items.first; item; item=item->next)
-               tot++;
-       
-       if(tot == 0)
-               return;
-       
        percentage= (split->percentage == 0.0f)? 1.0f/(float)tot: split->percentage;
        
        w= (litem->w - (tot-1)*litem->space);
index df9d477425ce14f0db286da8b7b118bc65542a57..1de693699f4d83fb79e9935e1e9a463b21d9e449 100644 (file)
@@ -1153,6 +1153,9 @@ static void paste_mtex_copybuf(ID *id)
                case ID_PA:
                        mtex= &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
                        break;
+               default:
+                       BLI_assert("invalid id type");
+                       return;
        }
        
        if(mtex) {
index cd37e0315b38f27549171090c513257df9aa87c3..c18ec4b617c16c42a11bd4ad476f7aa7a703e213 100644 (file)
@@ -5152,13 +5152,13 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
                drawcircball(GL_LINE_LOOP, vec, size*2.0, imat);
        }
        else if (pd->forcefield == PFIELD_VORTEX) {
-               float ffall_val, force_val;
+               float /*ffall_val,*/ force_val;
 
                unit_m4(tmat);
                //if (has_ipo_code(ob->ipo, OB_PD_FFALL)) 
                //      ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra);
                //else 
-                       ffall_val = pd->f_power;
+               //      ffall_val = pd->f_power;
 
                //if (has_ipo_code(ob->ipo, OB_PD_FSTR))
                //      force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra);
index 78da556210b91dbdf3424fd7d6656f776e83f736..fdcd3491af19eb8acb7c9da77a3c657614274a5f 100644 (file)
@@ -606,7 +606,6 @@ CineonFile*
 cineonOpenFromMem(unsigned char *mem, unsigned int size) {
 
        CineonGenericHeader header;
-       int i;
        
        CineonFile* cineon = (CineonFile* )malloc(sizeof(CineonFile));
        if (cineon == 0) {
@@ -670,8 +669,6 @@ cineonOpenFromMem(unsigned char *mem, unsigned int size) {
                return 0;
        }
        cineon->pixelBufferUsed = 0;
-
-       i = cineon->imageOffset;
        
        if (logimage_fseek(cineon, cineon->imageOffset, SEEK_SET) != 0) {
                if (verbose) d_printf("Couldn't seek to image data at %d\n", cineon->imageOffset);
index 292d7f7a65cfec5b08866f976c0058eaf25cacf1..237a0f9b2162124634d8d8aa68b6443cfa55a5c1 100644 (file)
@@ -518,14 +518,13 @@ static void remap_faces_23(DerivedMesh *dm, DerivedMesh *split, MFace *mf, int *
 
 static void remap_uvs_23(DerivedMesh *dm, DerivedMesh *split, int numlayer, int i, int cur, int c0, int c1, int c2)
 {
-       MTFace *mf, *df1, *df2, *df3;
+       MTFace *mf, *df1, *df2;
        int l;
 
        for(l=0; l<numlayer; l++) {
                mf = CustomData_get_layer_n(&split->faceData, CD_MTFACE, l);
                df1 = mf+cur;
                df2 = df1 + 1;
-               df3 = df1 + 2;
                mf = CustomData_get_layer_n(&dm->faceData, CD_MTFACE, l);
                mf += i;
 
index b914f63a384164d59fdff4c42e7de7bc20c8c8bd..fcdcb8028204bb8f19c3d4ce8017b0ca1288fc23 100644 (file)
@@ -279,7 +279,7 @@ int WM_init_game(bContext *C)
 
                /* full screen the area */
                if(!sa->full) {
-                       ED_screen_full_toggle(C, wm->windows.first, sa);
+                       ED_screen_full_toggle(C, win, sa);
                }
 
                /* Fullscreen */