Commit 016162b0 authored by David Gobbi's avatar David Gobbi
Browse files

COMP: fix signed/unsigned mismatch warnings

parent 97eb9cf9
...@@ -155,8 +155,8 @@ public: ...@@ -155,8 +155,8 @@ public:
void initialize(bool selfIsClass, const char *format); void initialize(bool selfIsClass, const char *format);
bool next(const char **format, const char **classname); bool next(const char **format, const char **classname);
int penalty() { return m_penalty; }; int penalty() { return m_penalty; };
int penalty(int penalty) { int penalty(int p) {
if (penalty > m_penalty) { m_penalty = penalty; }; if (p > m_penalty) { m_penalty = p; };
return m_penalty; }; return m_penalty; };
private: private:
...@@ -233,6 +233,8 @@ int vtkPythonIntPenalty(PY_LONG_LONG tmpi, int penalty, char format) ...@@ -233,6 +233,8 @@ int vtkPythonIntPenalty(PY_LONG_LONG tmpi, int penalty, char format)
int vtkPythonIntPenalty(long tmpi, int penalty, char format) int vtkPythonIntPenalty(long tmpi, int penalty, char format)
#endif #endif
{ {
tmpi; format; // avoid "unused parameter" compiler warnings
#if VTK_SIZEOF_LONG != VTK_SIZEOF_INT #if VTK_SIZEOF_LONG != VTK_SIZEOF_INT
if (tmpi > VTK_INT_MAX || tmpi < VTK_INT_MIN) if (tmpi > VTK_INT_MAX || tmpi < VTK_INT_MIN)
{ {
...@@ -573,10 +575,10 @@ int vtkPythonUtil::CheckArg( ...@@ -573,10 +575,10 @@ int vtkPythonUtil::CheckArg(
penalty = VTK_PYTHON_NEEDS_CONVERSION; penalty = VTK_PYTHON_NEEDS_CONVERSION;
// Look up the required type in the map // Look up the required type in the map
vtkPythonSpecialTypeMap::iterator i; vtkPythonSpecialTypeMap::iterator iter;
if (level != 0 || if (level != 0 ||
(i = vtkPythonMap->SpecialTypeMap->find(classname)) == (iter = vtkPythonMap->SpecialTypeMap->find(classname)) ==
vtkPythonMap->SpecialTypeMap->end()) vtkPythonMap->SpecialTypeMap->end())
{ {
penalty = VTK_PYTHON_INCOMPATIBLE; penalty = VTK_PYTHON_INCOMPATIBLE;
...@@ -584,7 +586,7 @@ int vtkPythonUtil::CheckArg( ...@@ -584,7 +586,7 @@ int vtkPythonUtil::CheckArg(
else else
{ {
// Get info about the required type // Get info about the required type
PyVTKSpecialType *info = &i->second; PyVTKSpecialType *info = &iter->second;
// Try out all the constructor methods // Try out all the constructor methods
if (!vtkPythonUtil::FindConversionMethod(info->constructors, arg)) if (!vtkPythonUtil::FindConversionMethod(info->constructors, arg))
...@@ -1514,7 +1516,7 @@ int vtkPythonUtil::CheckArray(PyObject *args, int i, bool *a, int n) ...@@ -1514,7 +1516,7 @@ int vtkPythonUtil::CheckArray(PyObject *args, int i, bool *a, int n)
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
PyObject *oldobj = PySequence_GetItem(seq, i); PyObject *oldobj = PySequence_GetItem(seq, i);
bool oldval = PyObject_IsTrue(oldobj); bool oldval = (PyObject_IsTrue(oldobj) != 0);
Py_DECREF(oldobj); Py_DECREF(oldobj);
changed |= (a[i] != oldval); changed |= (a[i] != oldval);
} }
......
...@@ -43,8 +43,7 @@ static void vtkWrapPython_CustomMethods( ...@@ -43,8 +43,7 @@ static void vtkWrapPython_CustomMethods(
/* print out all methods and the method table */ /* print out all methods and the method table */
static void vtkWrapPython_GenerateMethods( static void vtkWrapPython_GenerateMethods(
FILE *fp, FileInfo *data, int class_has_new, FILE *fp, FileInfo *data, int is_vtkobject, int do_constructors);
int is_vtkobject, int do_constructors);
/* make a temporary variable for an arg value or a return value */ /* make a temporary variable for an arg value or a return value */
static void vtkWrapPython_MakeTempVariable( static void vtkWrapPython_MakeTempVariable(
...@@ -732,7 +731,7 @@ static void vtkWrapPython_ReturnValue( ...@@ -732,7 +731,7 @@ static void vtkWrapPython_ReturnValue(
static char *vtkWrapPython_FormatString(FunctionInfo *currentFunction) static char *vtkWrapPython_FormatString(FunctionInfo *currentFunction)
{ {
static char result[1024]; static char result[1024];
int currPos = 0; size_t currPos = 0;
int argtype; int argtype;
int i, j; int i, j;
int typeChar; int typeChar;
...@@ -875,7 +874,7 @@ static char *vtkWrapPython_ArgCheckString( ...@@ -875,7 +874,7 @@ static char *vtkWrapPython_ArgCheckString(
int isvtkobjmethod, FunctionInfo *currentFunction) int isvtkobjmethod, FunctionInfo *currentFunction)
{ {
static char result[1024]; static char result[1024];
int currPos = 0; size_t currPos = 0;
int argtype; int argtype;
int i; int i;
...@@ -1608,8 +1607,7 @@ void vtkWrapPython_RemovePreceededMethods( ...@@ -1608,8 +1607,7 @@ void vtkWrapPython_RemovePreceededMethods(
* words, this poorly named function is "the big one". */ * words, this poorly named function is "the big one". */
static void vtkWrapPython_GenerateMethods( static void vtkWrapPython_GenerateMethods(
FILE *fp, FileInfo *data, int class_has_new, FILE *fp, FileInfo *data, int is_vtkobject, int do_constructors)
int is_vtkobject, int do_constructors)
{ {
int i, j, k, is_static, is_pure_virtual, fnum, occ; int i, j, k, is_static, is_pure_virtual, fnum, occ;
int numberOfSignatures, signatureCount; int numberOfSignatures, signatureCount;
...@@ -3034,7 +3032,7 @@ static void vtkWrapPython_GenerateSpecialObjectNew( ...@@ -3034,7 +3032,7 @@ static void vtkWrapPython_GenerateSpecialObjectNew(
int i; int i;
/* handle all constructors */ /* handle all constructors */
vtkWrapPython_GenerateMethods(fp, data, class_has_new, 0, 1); vtkWrapPython_GenerateMethods(fp, data, 0, 1);
/* the method table for the New method */ /* the method table for the New method */
fprintf(fp, fprintf(fp,
...@@ -3316,7 +3314,7 @@ void vtkParseOutput(FILE *fp, FileInfo *data) ...@@ -3316,7 +3314,7 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
/* now output all the methods are wrappable */ /* now output all the methods are wrappable */
if (is_vtkobject || !data->IsAbstract) if (is_vtkobject || !data->IsAbstract)
{ {
vtkWrapPython_GenerateMethods(fp, data, class_has_new, is_vtkobject, 0); vtkWrapPython_GenerateMethods(fp, data, is_vtkobject, 0);
} }
/* output the class initilization function for VTK objects */ /* output the class initilization function for VTK objects */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment