Routine purge of compiler warnings
authorJoshua Leung <aligorith@gmail.com>
Sun, 30 Dec 2007 23:27:35 +0000 (23:27 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 30 Dec 2007 23:27:35 +0000 (23:27 +0000)
* Most were uninitialised vars
* Fixed whitespace in a few places
* The change I made in rendercore.c -> do_bake_shade() was for an uninitialised var, but I hope it does't cause any rendering errors...

source/blender/blenkernel/intern/curve.c
source/blender/include/BDR_editobject.h
source/blender/render/intern/source/rendercore.c
source/blender/src/buttons_object.c
source/blender/src/editobject.c

index de4f4555823a3df5d402bfd179354efa0e19d136..fd22579ea67111897b68a03ba57c5303b1ac04ec 100644 (file)
@@ -1467,7 +1467,7 @@ void makeBevelList(Object *ob)
        BevPoint *bevp, *bevp2, *bevp1 = NULL, *bevp0;
        float  *data, *data_a, *v1, *v2, min, inp, x1, x2, y1, y2, vec[3];
        struct bevelsort *sortdata, *sd, *sd1;
-       int a, b, len, nr, poly, resolu;
+       int a, b, nr, poly, resolu, len=0;
 
        /* this function needs an object, because of tflag and upflag */
        cu= ob->data;
index 93e7873fe55f518a849b3e67ddcc3151991ca48c..b38ee8d393906e6b94ec5da9ebc09fd440e9ca78 100644 (file)
@@ -81,6 +81,7 @@ void make_links(short event);
 void make_duplilist_real(void);
 void apply_objects_locrot(void);
 void apply_objects_visual_tx(void);
+void apply_object(void);
 
 /* old transform */
 void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert);
index 5b9a275ad3267faff22f488121c4f1cb94d718f7..3eda349eef946f7e2b9c0643049708889d3d40ea 100644 (file)
@@ -1976,15 +1976,15 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
        if(bs->actob) {
                Isect isec, minisec;
                float co[3], minco[3];
-               int hit, sign, dir;
+               int hit, sign, dir=1;
                
                /* intersect with ray going forward and backward*/
                hit= 0;
                memset(&minisec, 0, sizeof(minisec));
                minco[0]= minco[1]= minco[2]= 0.0f;
-
+               
                VECCOPY(bs->dir, shi->vn);
-
+               
                for(sign=-1; sign<=1; sign+=2) {
                        memset(&isec, 0, sizeof(isec));
                        VECCOPY(isec.start, shi->co);
@@ -1992,7 +1992,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
                        isec.faceorig= (RayFace*)vlr;
                        isec.oborig= RAY_OBJECT_SET(&R, obi);
                        isec.userdata= bs;
-
+                       
                        if(bake_intersect_tree(R.raytree, &isec, shi->vn, sign, co)) {
                                if(!hit || VecLenf(shi->co, co) < VecLenf(shi->co, minco)) {
                                        minisec= isec;
@@ -2014,13 +2014,11 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
                        obi= RAY_OBJECT_GET(&R, minisec.ob);
                        quad= (minisec.isect == 2);
                        VECCOPY(shi->co, minco);
-
+                       
                        u= -minisec.u;
                        v= -minisec.v;
                        bake_set_shade_input(obi, vlr, shi, quad, 1, x, y, u, v);
                }
-               
-               
        }
 
        if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT)
index dc33f2d2ac466d1a2f29c3d92407a8ddae0ce106..8451a4c8afd8a636b6a5e150c906993caef02aec 100644 (file)
@@ -3752,7 +3752,6 @@ static void object_panel_particle_extra(Object *ob)
        ParticleSettings *part;
        short butx=0, buty=160, butw=150, buth=20;
        static short vgnum=0;
-       int event;
 
        if (psys==NULL) return;
        part=psys->part;
index 5c1742467b7d89fd617d799449648a4f19a38ff8..eea97e15f00f99c014e375b7555f040d2829d6d0 100644 (file)
@@ -3700,6 +3700,7 @@ void apply_objects_locrot( void )
 {
        Base *base, *basact;
        Object *ob;
+       bArmature *arm;
        Mesh *me;
        Curve *cu;
        Nurb *nu;
@@ -3714,21 +3715,23 @@ void apply_objects_locrot( void )
                if TESTBASELIB(base) {
                        ob= base->object;
                        if(ob->type==OB_MESH) {
+                               me= ob->data;
+                               
                                if(me->id.us>1) {
                                        error("Can't apply to a multi user mesh, doing nothing.");
-                                       return 0;
+                                       return;
                                }
                                if(me->key) {
                                        error("Can't apply to a mesh with vertex keys, doing nothing.");
-                                       return 0;
+                                       return;
                                }
                        }
-                       else if (ob->type==OB_ARMATURE){
-                               bArmature *arm;
+                       else if (ob->type==OB_ARMATURE) {
                                arm= ob->data;
+                               
                                if(arm->id.us>1) {
                                        error("Can't apply to a multi user armature, doing nothing.");
-                                       return 0;
+                                       return;
                                }
                        }
                        else if ELEM(ob->type, OB_CURVE, OB_SURF) {
@@ -3736,11 +3739,11 @@ void apply_objects_locrot( void )
                                
                                if(cu->id.us>1) {
                                        error("Can't apply to a multi user curve, doing nothing.");
-                                       return 0;
+                                       return;
                                }
                                if(cu->key) {
                                        error("Can't apply to a curve with vertex keys, doing nothing.");
-                                       return 0;
+                                       return;
                                }
                        }
                }
@@ -3752,7 +3755,7 @@ void apply_objects_locrot( void )
        for (base= FIRSTBASE; base; base= base->next) {
                if TESTBASELIB(base) {
                        ob= base->object;
-       
+                       
                        if(ob->type==OB_MESH) {
                                object_to_mat3(ob, mat);
                                me= ob->data;
@@ -3778,15 +3781,13 @@ void apply_objects_locrot( void )
                                
                                change = 1;
                        }
-                       else if (ob->type==OB_ARMATURE){
-                               bArmature *arm;
-
+                       else if (ob->type==OB_ARMATURE) {
                                object_to_mat3(ob, mat);
                                arm= ob->data;
                                
                                /* see checks above */
+                               apply_rot_armature(ob, mat);
                                
-                               apply_rot_armature (ob, mat);
                                /* Reset the object's transforms */
                                ob->size[0]= ob->size[1]= ob->size[2]= 1.0;
                                ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0;