Patch/Bugfix #7334 by 'gsr b3d:
authorJoshua Leung <aligorith@gmail.com>
Mon, 17 Sep 2007 06:11:06 +0000 (06:11 +0000)
committerJoshua Leung <aligorith@gmail.com>
Mon, 17 Sep 2007 06:11:06 +0000 (06:11 +0000)
Some more compiler warning fixes. Some of these seem to be specific to GCC 4.1

12 files changed:
intern/elbeem/intern/attributes.cpp
intern/elbeem/intern/particletracer.cpp
source/blender/python/api2_2x/Mesh.c
source/blender/python/api2_2x/Noise.c
source/blender/python/api2_2x/Pose.c
source/blender/python/api2_2x/bpy_data.c
source/blender/render/intern/source/texture.c
source/blender/src/editmesh_mods.c
source/blender/src/editnla.c
source/blender/src/editscreen.c
source/blender/src/transform.c
source/blender/src/transform_generics.c

index 890d6e75c9ee75d8d918ab126a808c0648a22af9..8e337a92a4e61648629372332d84d488b4b3e4f2 100644 (file)
@@ -103,6 +103,7 @@ void AttributeList::readMat4Gfx(string name, ntlMat4Gfx defaultValue, string sou
 
 // set that a parameter can be given, and will be ignored...
 bool AttributeList::ignoreParameter(string name, string source) {
+       name=source=(""); // remove warning
        return false;
 }
                
index c537a893c27248ce6f8d33fb7aa50206b752d6ef..c9da808543a0a9f8acc77430a9c71e43fa1f31f2 100644 (file)
@@ -325,6 +325,7 @@ void ParticleTracer::getTriangles(double time, vector<ntlTriangle> *triangles,
        // suppress warnings...
        vertices = NULL; triangles = NULL;
        normals = NULL; objectId = 0;
+       time = 0.0;
 #else // ELBEEM_PLUGIN
        int pcnt = 0;
        // currently not used in blender
index 6967b64da7216ba25e8b9aac47e931d3b6c7b0e9..d2cc1edf3c3cc480363c3f745447be1027338b23 100644 (file)
@@ -1345,8 +1345,8 @@ static PyObject *Mesh_getProperty_internal(CustomData *data, int eindex, PyObjec
 static PyObject *Mesh_setProperty_internal(CustomData *data, int eindex, PyObject *args)
 {
        CustomDataLayer *layer;
-       int i,index, type = -1;
-       float f;
+       int i = 0, index, type = -1;
+       float f = 0.0f;
        char *s=NULL, *name=NULL;
        MFloatProperty *pf;
        MIntProperty  *pi;
index 5253ea810b0ccda7245e3b9cad83ef250676799d..c1a41d46714f71cfc82ed12b71bd465c4f0aeb52 100644 (file)
@@ -199,7 +199,7 @@ static PyObject *Noise_random( PyObject * self )
 
 static PyObject *Noise_randuvec( PyObject * self )
 {
-       float v[3];
+       float v[3] = {0.0f, 0.0f, 0.0f};
        randuvec( v );
        return Py_BuildValue( "[fff]", v[0], v[1], v[2] );
 }
index ed25c15c9f592f64e18e3ce8e556a376326f5e00..47ae96b2286939533027f1fcde99431ced7f2f66 100644 (file)
@@ -693,9 +693,12 @@ static int PoseBone_setLocalMatrix(BPy_PoseBone *self, PyObject *value, void *cl
        }
 
        //get loc
-       if (matsize == 4){
+       if (matsize == 4) {
                VECCOPY(loc, matrix->matrix[3]);
        }
+       else {
+               loc[0]= loc[1]= loc[2]= 0.0f;
+       }
 
        //copy new attributes
        VECCOPY(self->posechannel->size, size);
index b775c0a82363153489591cd39a682f1fdb7749ed..edb894bd982a73564f25958cb407d0149dab5884 100644 (file)
@@ -407,7 +407,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
                static char *kwlist[] = {"name", "filename", NULL};
                
                if(PyArg_ParseTupleAndKeywords(args, kwd, "|ss", kwlist, &name, &filename) && filename ) {
-                       PyObject *ret;
+                       PyObject *ret= NULL;
                        
                        if (strlen(filename) > FILE_MAXDIR + FILE_MAXFILE - 1)
                                        return ( EXPP_ReturnPyObjError( PyExc_IOError,
index 814309e9e31aeb15a8b869710b77d625b8e35a51..8c366593034e879c3bb02bbec434794f87a7f28e 100644 (file)
@@ -1390,7 +1390,7 @@ void do_material_tex(ShadeInput *shi)
        TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
        float *co = NULL, *dx = NULL, *dy = NULL;
        float fact, facm, factt, facmm, stencilTin=1.0;
-       float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3], warpvec[3], Tnor=1.0;
+       float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3], warpvec[3]={0.0f, 0.0f, 0.0f}, Tnor=1.0;
        int tex_nr, rgbnor= 0, warpdone=0;
 
        if (R.r.scemode & R_NO_TEX) return;
index ffe4bc61764419d659cc2199284c1dc4f91929b6..c117fd514d77148b499e360eba443b3652058f02 100644 (file)
@@ -1538,7 +1538,7 @@ void mesh_copy_menu(void)
                                error("mesh has no color layers");
                                return;
                        } else {
-                               /* guess teh 4th color if needs be */
+                               /* guess the 4th color if needs be */
                                float val =- 1;
                                
                                if (!efa_act->v4) {
index 2233db6e3461922b585650d1cb5bcbb9f6684742..9115665afa0420b5084fe838db355401f61f56f6 100644 (file)
@@ -980,7 +980,7 @@ void transform_nlachannel_keys(int mode, int dummy)
        bActionChannel *chan;
        bActionStrip *strip;
        bConstraintChannel *conchan;
-       float   sval[2], cval[2], lastcval[2];
+       float   sval[2], cval[2], lastcval[2]= {0.0f, 0.0f};
        float   fac=0.0F;
        float   deltax, startx;
        int i;
@@ -1077,7 +1077,7 @@ void transform_nlachannel_keys(int mode, int dummy)
                                for (chan=base->object->action->chanbase.first; chan; chan=chan->next){
                                        if (EDITABLE_ACHAN(chan)) {
                                                tvtot=add_trans_ipo_keys(chan->ipo, tv, tvtot);
-
+                                               
                                                /* Manipulate action constraint ipos */
                                                if (EXPANDED_ACHAN(chan) && FILTER_CON_ACHAN(chan)) {
                                                        for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) {
index b877915b1d6fe35af805f8286acfb405f3f3f607..9ae46998cbc6f3e8cd5ed3e9034f68b8e6a2ccff 100644 (file)
@@ -3074,7 +3074,7 @@ static void splitarea_interactive(ScrArea *area, ScrEdge *onedge)
        ScrArea *scr, *sa= area;
        float fac= 0.0;
        unsigned short event;
-       short ok= 0, val, split = 0, mval[2], mvalo[2], first= 1;
+       short ok= 0, val, split = 0, mval[2], mvalo[2]= {-1, -1}, first= 1;
        char dir;
        
        if(sa->win==0) return;
index b3814831ddf9551f7329d0dfd26f7f8eaa6caea6..e8512d08d04027bc2adb09428b8082a66e8cad10 100644 (file)
@@ -1972,6 +1972,9 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
        if (t->around == V3D_LOCAL) {
                VECCOPY(center, t->center);
        }
+       else {
+               center[0] = center[1] = center[2] = 0.0f;
+       }
 
        VecRotToMat3(axis, angle, mat);
        
index 8e92fdda38abea9c42bf33f7da47dbf088b2faf3..357623ea4943301274eec23e198dd317bc3f0d76 100644 (file)
@@ -139,7 +139,7 @@ void getViewVector(float coord[3], float vec[3])
 static void clipMirrorModifier(TransInfo *t, Object *ob)
 {
        ModifierData *md= ob->modifiers.first;
-       float tolerance[3];
+       float tolerance[3] = {0.0f, 0.0f, 0.0f};
        int axis = 0;
 
        for (; md; md=md->next) {