cosmetic fix to avoid warnings in the generated code

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5694 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-01-28 01:47:19 +00:00
commit 2f9749cb04

View file

@ -508,7 +508,6 @@ public:
int varargs = 0; int varargs = 0;
int allow_kwargs = check_kwargs(n); int allow_kwargs = check_kwargs(n);
/* member of a director class? */
String *nodeType = Getattr(n, "nodeType"); String *nodeType = Getattr(n, "nodeType");
int constructor = (!Cmp(nodeType, "constructor")); int constructor = (!Cmp(nodeType, "constructor"));
int destructor = (!Cmp(nodeType, "destructor")); int destructor = (!Cmp(nodeType, "destructor"));
@ -974,8 +973,8 @@ public:
/* Create a function for setting the value of the variable */ /* Create a function for setting the value of the variable */
Printf(setf->def,"static int %s_set(PyObject *_val) {", wname);
if (!Getattr(n,"feature:immutable")) { if (!Getattr(n,"feature:immutable")) {
Printf(setf->def,"static int %s_set(PyObject *_val) {", wname);
if ((tm = Swig_typemap_lookup_new("varin",n,name,0))) { if ((tm = Swig_typemap_lookup_new("varin",n,name,0))) {
Replaceall(tm,"$source","_val"); Replaceall(tm,"$source","_val");
Replaceall(tm,"$target",name); Replaceall(tm,"$target",name);
@ -989,6 +988,7 @@ public:
Printf(setf->code," return 0;\n"); Printf(setf->code," return 0;\n");
} else { } else {
/* Is a readonly variable. Issue an error */ /* Is a readonly variable. Issue an error */
Printf(setf->def,"static int %s_set(PyObject *) {", wname);
Printv(setf->code, Printv(setf->code,
tab4, "PyErr_SetString(PyExc_TypeError,\"Variable ", iname, tab4, "PyErr_SetString(PyExc_TypeError,\"Variable ", iname,
" is read-only.\");\n", " is read-only.\");\n",