remove some unused code and reduced the scope if some vars (no functional change).
authorCampbell Barton <ideasman42@gmail.com>
Tue, 5 Oct 2010 21:22:33 +0000 (21:22 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 5 Oct 2010 21:22:33 +0000 (21:22 +0000)
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/unit.c
source/blender/python/intern/bpy_rna.c

index 47627d09b97276f32166624f2ac2491e8a1fb715..131b16b319ea369aa09d1a3759fc4a31f0ed6095 100644 (file)
@@ -514,11 +514,12 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float
        float *fp, fsize, shear, x, si, co;
        VFontData *vfd = NULL;
        VChar *che = NULL;
-       int i, sel=0;
+       int i;
 
        vfd= vfont_get_data(which_vfont(cu, info));     
        if (!vfd) return;
 
+       /*
        if (cu->selend < cu->selstart) {
                if ((charidx >= (cu->selend)) && (charidx <= (cu->selstart-2)))
                        sel= 1;
@@ -527,6 +528,7 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float
                if ((charidx >= (cu->selstart-1)) && (charidx <= (cu->selend-1)))
                        sel= 1;
        }
+       */
 
        /* make a copy at distance ofsx,ofsy with shear*/
        fsize= cu->fsize;
@@ -1148,14 +1150,12 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
 
        if(mode == FO_EDIT) {
                /* make nurbdata */
-               unsigned long cha;
-               
                freeNurblist(&cu->nurb);
                
                ct= chartransdata;
                if (cu->sepchar==0) {
                        for (i= 0; i<slen; i++) {
-                               cha = (uintptr_t) mem[i];
+                               unsigned long cha = (uintptr_t) mem[i];
                                info = &(custrinfo[i]);
                                if (info->mat_nr > (ob->totcol)) {
                                        /* printf("Error: Illegal material index (%d) in text object, setting to 0\n", info->mat_nr); */
index a0df73d6c42d6ce972c04647f2777798d6eb45fa..639e2062f8325d2d2be88457b874ed72394d33ae 100644 (file)
@@ -421,9 +421,7 @@ void IDP_SyncGroupValues(IDProperty *dest, IDProperty *src)
        IDProperty *loop, *prop;
        for (prop=src->data.group.first; prop; prop=prop->next) {
                for (loop=dest->data.group.first; loop; loop=loop->next) {
-                       if (BSTR_EQ(loop->name, prop->name)) {
-                               int copy_done= 0;
-
+                       if (strcmp(loop->name, prop->name)==0) {
                                if(prop->type==loop->type) {
 
                                        switch (prop->type) {
@@ -431,11 +429,9 @@ void IDP_SyncGroupValues(IDProperty *dest, IDProperty *src)
                                                case IDP_FLOAT:
                                                case IDP_DOUBLE:
                                                        loop->data= prop->data;
-                                                       copy_done= 1;
                                                        break;
                                                case IDP_GROUP:
                                                        IDP_SyncGroupValues(loop, prop);
-                                                       copy_done= 1;
                                                        break;
                                                default:
                                                {
@@ -702,7 +698,6 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, const char *name)
                case IDP_STRING:
                {
                        char *st = val.str;
-                       int stlen;
 
                        prop = MEM_callocN(sizeof(IDProperty), "IDProperty string");
                        if (st == NULL) {
@@ -710,7 +705,7 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, const char *name)
                                prop->totallen = DEFAULT_ALLOC_FOR_NULL_STRINGS;
                                prop->len = 1; /*NULL string, has len of 1 to account for null byte.*/
                        } else {
-                               stlen = strlen(st) + 1;
+                               int stlen = strlen(st) + 1;
                                prop->data.pointer = MEM_callocN(stlen, "id property string 2");
                                prop->len = prop->totallen = stlen;
                                strcpy(prop->data.pointer, st);
index cb2261932ce1a0be43fc583d2d4f8e8cf1d93186..6dd1d4280ec535f1d67bc33519fa3d0d3cae75a5 100644 (file)
@@ -596,7 +596,7 @@ void BKE_image_free_all_textures(void)
 {
        Tex *tex;
        Image *ima;
-       unsigned int totsize= 0;
+       /* unsigned int totsize= 0; */
        
        for(ima= G.main->image.first; ima; ima= ima->id.next)
                ima->id.flag &= ~LIB_DOIT;
@@ -607,13 +607,14 @@ void BKE_image_free_all_textures(void)
        
        for(ima= G.main->image.first; ima; ima= ima->id.next) {
                if(ima->ibufs.first && (ima->id.flag & LIB_DOIT)) {
+                       /*
                        ImBuf *ibuf;
                        for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) {
                                if(ibuf->mipmap[0]) 
                                        totsize+= 1.33*ibuf->x*ibuf->y*4;
                                else
                                        totsize+= ibuf->x*ibuf->y*4;
-                       }
+                       } */
                        image_free_buffers(ima);
                }
        }
@@ -2183,7 +2184,7 @@ ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser)
 
 void BKE_image_user_calc_frame(ImageUser *iuser, int cfra, int fieldnr)
 {
-       int imanr, len;
+       int len;
        
        /* here (+fie_ima/2-1) makes sure that division happens correctly */
        len= (iuser->fie_ima*iuser->frames)/2;
@@ -2192,8 +2193,9 @@ void BKE_image_user_calc_frame(ImageUser *iuser, int cfra, int fieldnr)
                iuser->framenr= 0;
        }
        else {
+               int imanr;
                cfra= cfra - iuser->sfra+1;
-               
+
                /* cyclic */
                if(iuser->cycl) {
                        cfra= ( (cfra) % len );
index 3d984c7e8777181fda6d54184d837725a54e9c2c..25aab77ba9b1e295f6ffa97a520eaf1bb405f608 100644 (file)
@@ -398,7 +398,6 @@ void bUnit_AsString(char *str, int len_max, double value, int prec, int system,
    
        /* split output makes sense only for length, mass and time */
        if(split && (type==B_UNIT_LENGTH || type==B_UNIT_MASS || type==B_UNIT_TIME)) {
-               int i;
                bUnitDef *unit_a, *unit_b;
                double value_a, value_b;
 
@@ -406,7 +405,7 @@ void bUnit_AsString(char *str, int len_max, double value, int prec, int system,
 
                /* check the 2 is a smaller unit */
                if(unit_b > unit_a) {
-                       i= unit_as_string(str, len_max, value_a, prec, usys,  unit_a, '\0');
+                       int i= unit_as_string(str, len_max, value_a, prec, usys,  unit_a, '\0');
 
                        /* is there enough space for at least 1 char of the next unit? */
                        if(i+2 < len_max) {
index 93106d5400f4a82a989cfad7d0e60a5cb471a61b..166213fa07cd675a93688d2e34499609c467b258 100644 (file)
@@ -3459,10 +3459,9 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, ParameterList *parms, PropertyRNA *
        PyObject *ret;
        int type = RNA_property_type(prop);
        int flag = RNA_property_flag(prop);
-       int a;
 
        if(RNA_property_array_check(ptr, prop)) {
-               int len;
+               int a, len;
 
                if (flag & PROP_DYNAMIC) {
                        ParameterDynAlloc *data_alloc= data;