warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6628 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1c8c536fb5
commit
49b2144e84
1 changed files with 1 additions and 5 deletions
|
|
@ -9,20 +9,17 @@ extern int gcd(int x, int y);
|
|||
int i;
|
||||
if (!PyList_Check($input)) {
|
||||
SWIG_exception(SWIG_ValueError, "Expecting a list");
|
||||
return NULL;
|
||||
}
|
||||
$1 = PyList_Size($input);
|
||||
if ($1 == 0) {
|
||||
SWIG_exception(SWIG_ValueError, "List must contain at least 1 element");
|
||||
return NULL;
|
||||
}
|
||||
$2 = (char **) malloc(($1+1)*sizeof(char *));
|
||||
for (i = 0; i < $1; i++) {
|
||||
PyObject *s = PyList_GetItem($input,i);
|
||||
if (!PyString_Check(s)) {
|
||||
SWIG_exception(SWIG_ValueError, "List items must be strings");
|
||||
free($2);
|
||||
return NULL;
|
||||
SWIG_exception(SWIG_ValueError, "List items must be strings");
|
||||
}
|
||||
$2[i] = PyString_AsString(s);
|
||||
}
|
||||
|
|
@ -74,7 +71,6 @@ extern void capitalize(char *str, int len);
|
|||
double a = $1*$1 + $2*$2;
|
||||
if (a > 1.0) {
|
||||
SWIG_exception(SWIG_ValueError,"$1_name and $2_name must be in unit circle");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue