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:
parent
cff86e376c
commit
2f9749cb04
1 changed files with 2 additions and 2 deletions
|
|
@ -508,7 +508,6 @@ public:
|
|||
int varargs = 0;
|
||||
int allow_kwargs = check_kwargs(n);
|
||||
|
||||
/* member of a director class? */
|
||||
String *nodeType = Getattr(n, "nodeType");
|
||||
int constructor = (!Cmp(nodeType, "constructor"));
|
||||
int destructor = (!Cmp(nodeType, "destructor"));
|
||||
|
|
@ -974,8 +973,8 @@ public:
|
|||
|
||||
/* 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")) {
|
||||
Printf(setf->def,"static int %s_set(PyObject *_val) {", wname);
|
||||
if ((tm = Swig_typemap_lookup_new("varin",n,name,0))) {
|
||||
Replaceall(tm,"$source","_val");
|
||||
Replaceall(tm,"$target",name);
|
||||
|
|
@ -989,6 +988,7 @@ public:
|
|||
Printf(setf->code," return 0;\n");
|
||||
} else {
|
||||
/* Is a readonly variable. Issue an error */
|
||||
Printf(setf->def,"static int %s_set(PyObject *) {", wname);
|
||||
Printv(setf->code,
|
||||
tab4, "PyErr_SetString(PyExc_TypeError,\"Variable ", iname,
|
||||
" is read-only.\");\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue