Omit unused parameter names for C++ code only; this is illegal in C.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5702 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Logan Johnson 2004-02-09 23:08:54 +00:00
commit 8f7e15900e

View file

@ -548,15 +548,29 @@ public:
if (!allow_kwargs || Getattr(n,"sym:overloaded")) { if (!allow_kwargs || Getattr(n,"sym:overloaded")) {
if (!varargs) { if (!varargs) {
Printv(f->def, if (CPlusPlus) {
"static PyObject *", wname, Printv(f->def,
"(PyObject *self, PyObject *args) {", "static PyObject *", wname,
NIL); "(PyObject *, PyObject *args) {",
NIL);
} else {
Printv(f->def,
"static PyObject *", wname,
"(PyObject *self, PyObject *args) {",
NIL);
}
} else { } else {
Printv(f->def, if (CPlusPlus) {
"static PyObject *", wname, "__varargs__", Printv(f->def,
"(PyObject *self, PyObject *args, PyObject *varargs) {", "static PyObject *", wname, "__varargs__",
NIL); "(PyObject *, PyObject *args, PyObject *varargs) {",
NIL);
} else {
Printv(f->def,
"static PyObject *", wname, "__varargs__",
"(PyObject *self, PyObject *args, PyObject *varargs) {",
NIL);
}
} }
if (allow_kwargs) { if (allow_kwargs) {
Swig_warning(WARN_LANG_OVERLOAD_KEYWORD, input_file, line_number, Swig_warning(WARN_LANG_OVERLOAD_KEYWORD, input_file, line_number,
@ -569,10 +583,17 @@ public:
"Can't wrap varargs with keyword arguments enabled\n"); "Can't wrap varargs with keyword arguments enabled\n");
varargs = 0; varargs = 0;
} }
Printv(f->def, if (CPlusPlus) {
"static PyObject *", wname, Printv(f->def,
"(PyObject *, PyObject *args, PyObject *kwargs) {", "static PyObject *", wname,
NIL); "(PyObject *, PyObject *args, PyObject *kwargs) {",
NIL);
} else {
Printv(f->def,
"static PyObject *", wname,
"(PyObject *self, PyObject *args, PyObject *kwargs) {",
NIL);
}
} }
if (!allow_kwargs) { if (!allow_kwargs) {
Printf(parse_args," if(!PyArg_ParseTuple(args,(char *)\""); Printf(parse_args," if(!PyArg_ParseTuple(args,(char *)\"");
@ -1776,14 +1797,25 @@ public:
{ {
SwigType *ct = NewStringf("p.%s", real_classname); SwigType *ct = NewStringf("p.%s", real_classname);
SwigType_remember(ct); SwigType_remember(ct);
Printv(f_wrappers, if (CPlusPlus) {
"static PyObject * ", class_name, "_swigregister(PyObject *self, PyObject *args) {\n", Printv(f_wrappers,
tab4, "PyObject *obj;\n", "static PyObject * ", class_name, "_swigregister(PyObject *, PyObject *args) {\n",
tab4, "if (!PyArg_ParseTuple(args,(char*)\"O\", &obj)) return NULL;\n", tab4, "PyObject *obj;\n",
tab4, "SWIG_TypeClientData(SWIGTYPE", SwigType_manglestr(ct),", obj);\n", tab4, "if (!PyArg_ParseTuple(args,(char*)\"O\", &obj)) return NULL;\n",
tab4, "Py_INCREF(obj);\n", tab4, "SWIG_TypeClientData(SWIGTYPE", SwigType_manglestr(ct),", obj);\n",
tab4, "return Py_BuildValue((char *)\"\");\n", tab4, "Py_INCREF(obj);\n",
"}\n",NIL); tab4, "return Py_BuildValue((char *)\"\");\n",
"}\n",NIL);
} else {
Printv(f_wrappers,
"static PyObject * ", class_name, "_swigregister(PyObject *self, PyObject *args) {\n",
tab4, "PyObject *obj;\n",
tab4, "if (!PyArg_ParseTuple(args,(char*)\"O\", &obj)) return NULL;\n",
tab4, "SWIG_TypeClientData(SWIGTYPE", SwigType_manglestr(ct),", obj);\n",
tab4, "Py_INCREF(obj);\n",
tab4, "return Py_BuildValue((char *)\"\");\n",
"}\n",NIL);
}
String *cname = NewStringf("%s_swigregister", class_name); String *cname = NewStringf("%s_swigregister", class_name);
add_method(cname, cname, 0); add_method(cname, cname, 0);
Delete(cname); Delete(cname);