Misc warnings
authorCampbell Barton <ideasman42@gmail.com>
Tue, 26 May 2009 10:44:14 +0000 (10:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 26 May 2009 10:44:14 +0000 (10:44 +0000)
- Removed/Commented some unused vars
- CValue::GetPropertyText() could return a temp reference to a variable on the stack, option wasnt used anywhere so removed.
- KX_ConstraintWrapper::GetConstraintId allows args but ignored them
- KX_ConstraintWrapper::PySetParam didnt return NULL on an error (messing up pythons exceptions).
- BLI_natstrcmp didnt return 0 when the while loop exited

16 files changed:
source/blender/blenkernel/bad_level_call_stubs/stubs.c
source/blender/blenkernel/intern/anim.c
source/blender/blenlib/intern/util.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/python/api2_2x/Geometry.c
source/blender/src/butspace.c
source/blender/src/buttons_editing.c
source/blender/src/drawobject.c
source/gameengine/Expressions/Value.cpp
source/gameengine/Expressions/Value.h
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
source/gameengine/Ketsji/KX_ConstraintWrapper.h
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/VideoTexture/PyTypeList.cpp

index 3012c19ff02788e987b7bf5eca6bafbd401cd384..1a33102f84501eb08452fc9ea74b38949ac180ff 100644 (file)
@@ -57,6 +57,7 @@ struct bConstraintOb;
 struct bConstraintTarget;
 struct ListBase;
 struct EditFace;
+struct LOD_Decimation_Info;
 
 char *getIpoCurveName( struct IpoCurve * icu );
 void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast);
@@ -160,7 +161,7 @@ void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTa
 void free_oops(struct Oops *oops){}
 void exit_posemode(int freedata){}
 void error(char *str, ...){}
-int okee(char *str, ...){}
+int okee(char *str, ...){return 1;}
 
 /* anim.c */
 ListBase editNurb;
index 50be417c8efc5f362680de3e6e6f49c657984c95..ffb7ff51b87b403dea576fc2c94638545bed44b9 100644 (file)
@@ -747,7 +747,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
        float ctime, pa_time, scale = 1.0f;
        float tmat[4][4], mat[4][4], pamat[4][4], size=0.0;
        float (*obmat)[4], (*oldobmat)[4];
-       int lay, a, b, k, counter, hair = 0;
+       int lay, a, b, counter, hair = 0;
        int totpart, totchild, totgroup=0, pa_num;
 
        if(psys==0) return;
index 842ebc4c0a96b4d9955e1d7f97f07d62af1a481f..e202d91f0e693ad58c63ad1494a48137eec3deab 100644 (file)
@@ -2030,7 +2030,7 @@ int BLI_natstrcmp(const char *s1, const char *s2)
                d1++;
                d2++;
        }
-       
+       return 0;
 }
 
 
index 9e077cbc8093aabc977a0afcca716d1fc1648edb..32d97d79bd79680d6155be57042372f3fabffa1f 100644 (file)
@@ -865,7 +865,7 @@ static const char *exr_rgba_channelname(InputFile *file, const char *chan)
        
        for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i)
        {
-               const Channel &channel = i.channel();
+               /* const Channel &channel = i.channel(); */ /* Not used yet */
                const char *str= i.name();
                int len= strlen(str);
                if(len) {
index 2ac6b8a714a19cf661fd77271398d0b24c5e587f..f875cbc52fb5ef85173c2a9f4027b7575137e550 100644 (file)
@@ -488,7 +488,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args )
        float k2[4] = {0.0, 0.0, 0.0, 0.0};
        float h2[4] = {0.0, 0.0, 0.0, 0.0};
        
-       float a1x, a1y, a2x, a2y,  b1x, b1y, b2x, b2y, xi, yi, a1,a2,b1,b2, newvec[2];
+       
        if( !PyArg_ParseTuple ( args, "O!O!O!O!i",
          &vector_Type, &vec_k1,
          &vector_Type, &vec_h1,
index ba4d02d2355f6b78aed344f9d3c8154974f92495..38d628d20569455963992c20473e4bf87540d9d8 100644 (file)
@@ -511,7 +511,7 @@ void curvemap_buttons(uiBlock *block, CurveMapping *cumap, char labeltype, short
 static void do_node_buts(unsigned short event)
 {
        Material *ma;
-       SpaceNode *snode = curarea->spacedata.first;
+       /* SpaceNode *snode = curarea->spacedata.first; */
        
        /* all operations default on active material layer here */
        /* but this also gets called for lamp and world... */
index 1ecc63fe93d0fdd1bb37e3cab79b8a997c86bc31..43fafeb387a5af11bd211fb562187cd9b4289960 100644 (file)
@@ -6437,7 +6437,7 @@ void brush_buttons(uiBlock *block, short sima,
                }
                else {
                        if (
-                               (sima==NULL) && /* 3D View */
+                               (!sima) && /* 3D View */
                                (settings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE)==0 && /* Projection Painting */
                                (settings->imapaint.tool == PAINT_TOOL_CLONE)
                        ) {
index 5fb60449a250864b45866cff084ed635958ad127..ef37b184a855603a2d94a657a844065e5763fffb 100644 (file)
@@ -2918,7 +2918,7 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys, int dt)
        float cfra=bsystem_time(ob,(float)CFRA,0.0);
        float *vdata=0, *vedata=0, *cdata=0, *ndata=0, *vd=0, *ved=0, *cd=0, *nd=0, xvec[3], yvec[3], zvec[3];
        float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f;
-       int a, k, k_max=0, totpart, totpoint=0, draw_as, totchild=0;
+       int a, totpart, totpoint=0, draw_as, totchild=0;
        int select=ob->flag&SELECT, create_cdata=0;
        GLint polygonmode[2];
        char val[32];
index 773fd94a0fbb51975b5077f1e07d374f911a583d..08249f92902f1a8caaf6d71dbcb113ff7faf4347 100644 (file)
@@ -292,15 +292,13 @@ CValue* CValue::GetProperty(const char *inName)
 //
 // Get text description of property with name <inName>, returns an empty string if there is no property named <inName>
 //
-const STR_String& CValue::GetPropertyText(const STR_String & inName,const char *deftext)
+const STR_String& CValue::GetPropertyText(const STR_String & inName)
 {
        const static STR_String sEmpty("");
 
        CValue *property = GetProperty(inName);
        if (property)
                return property->GetText();
-       else if (deftext)
-               return STR_String(deftext);
        else
                return sEmpty;
 }
index 0be76c4f452d963936e5bf981eb7304e48e8b649..29ef19b46c972019fceefc19d6ae8dd745b2c289 100644 (file)
@@ -310,7 +310,7 @@ public:
        virtual void            SetProperty(const char* name,CValue* ioProperty);
        virtual CValue*         GetProperty(const char* inName);                                                        // Get pointer to a property with name <inName>, returns NULL if there is no property named <inName>
        virtual CValue*         GetProperty(const STR_String & inName);
-       const STR_String&       GetPropertyText(const STR_String & inName,const char *deftext=NULL);                                            // Get text description of property with name <inName>, returns an empty string if there is no property named <inName>
+       const STR_String&       GetPropertyText(const STR_String & inName);                                             // Get text description of property with name <inName>, returns an empty string if there is no property named <inName>
        float                           GetPropertyNumber(const STR_String& inName,float defnumber);
        virtual bool            RemoveProperty(const char *inName);                                             // Remove the property named <inName>, returns true if the property was succesfully removed, false if property was not found or could not be removed
        virtual vector<STR_String>      GetPropertyNames();
index 1a0d985a864d80152a23e0d6a0bf04bb17639a17..02f23a8431b7a0cc3327a0a502f943b68a02829c 100644 (file)
@@ -288,10 +288,7 @@ void GPC_RenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
                                                                                 int height)
 {
        STR_String tmpstr(text);
-       int lines;
        char* s = tmpstr.Ptr();
-       char* p;
-       
 
        // Save and change OpenGL settings
        int texture2D;
index 144ff4ac8834a06407ffda7d5ff574952006fdb2..1d6c5f77ae57961a95fabdc3aa946767c5a997e4 100644 (file)
@@ -1105,7 +1105,6 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
 "getScreenRay()\n"
 )
 {
-       KX_Camera* cam;
        MT_Vector3 vect;
        double x,y,dist;
        char *propName = NULL;
index b40100db2f7308cc70cce7648f025f9fd86a7b5c..3e5594e0d1c45b42524f125db207408a4cbf4b02 100644 (file)
@@ -49,23 +49,20 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper()
 {
 }
 
-PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* args, PyObject* kwds)
+PyObject* KX_ConstraintWrapper::PyGetConstraintId()
 {
        return PyInt_FromLong(m_constraintId);
 }
 
 PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds)
 {
-       int len = PyTuple_Size(args);
-       int success = 1;
-       
        int dof;
        float minLimit,maxLimit;
-       success = PyArg_ParseTuple(args,"iff:setParam",&dof,&minLimit,&maxLimit);
-       if (success)
-       {
-               m_physenv->setConstraintParam(m_constraintId,dof,minLimit,maxLimit);
-       }
+       
+       if (!PyArg_ParseTuple(args,"iff:setParam",&dof,&minLimit,&maxLimit))
+               return NULL;
+       
+       m_physenv->setConstraintParam(m_constraintId,dof,minLimit,maxLimit);
        Py_RETURN_NONE;
 }
 
@@ -120,7 +117,7 @@ int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value)
 
 
 PyMethodDef KX_ConstraintWrapper::Methods[] = {
-       {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_VARARGS},
+       {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_NOARGS},
        {"setParam",(PyCFunction) KX_ConstraintWrapper::sPySetParam, METH_VARARGS},
        {NULL,NULL} //Sentinel
 };
index b8ac464ceab6da58397bf7b0fb2cf4277014f630..d4f038e2898c6070fc8efe518e85187faf583c04 100644 (file)
@@ -43,8 +43,7 @@ public:
        virtual ~KX_ConstraintWrapper ();
        int                     getConstraintId() { return m_constraintId;};
        
-       KX_PYMETHOD(KX_ConstraintWrapper,TestMethod);
-       KX_PYMETHOD(KX_ConstraintWrapper,GetConstraintId);
+       KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId);
        KX_PYMETHOD(KX_ConstraintWrapper,SetParam);
 
 private:
index 0d1bc289a5c254e0fc794eadb3a5176282593fd6..11effa1ca980a0cd09d532cfc764a947bd58da8f 100644 (file)
@@ -222,7 +222,6 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds)
 {
     int vertexindex;
        int matindex;
-       PyObject* vertexob = NULL;
 
        if (!PyArg_ParseTuple(args,"ii:getVertex",&matindex,&vertexindex))
                return NULL;
index 6d2676dce09b139c8e6aeb1d741fc57e21ce3a96..2d571675dbd834ce0d222be587131af9f53344d9 100644 (file)
@@ -45,7 +45,6 @@ bool PyTypeList::in (PyTypeObject * type)
 /// add type to list
 void PyTypeList::add (PyTypeObject * type, const char * name)
 {
-       PyTypeListItem * typeItem;
        // if list doesn't exist, create it
        if (m_list.get() == NULL) 
                m_list.reset(new PyTypeListType());