Misc warnings

- 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
This commit is contained in:
Campbell Barton 2009-05-26 10:44:14 +00:00
parent ca4d741ce9
commit e93d1ba8e7
16 changed files with 19 additions and 30 deletions

View 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;

View 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;

View File

@ -2030,7 +2030,7 @@ int BLI_natstrcmp(const char *s1, const char *s2)
d1++;
d2++;
}
return 0;
}

View 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) {

View 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,

View 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... */

View 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)
) {

View 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];

View 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;
}

View 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();

View 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;

View 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;

View 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
};

View 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:

View 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;

View 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());