API cleanup (Parms)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9633 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ff41049b1c
commit
b00cef436b
12 changed files with 94 additions and 78 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
<p>
|
<p>
|
||||||
David M. Beazley <br>
|
David M. Beazley <br>
|
||||||
dave-swig@dabeaz.com<br>
|
dave-swig@dabeaz.com<br>
|
||||||
January 2, 2007<br>
|
January 9, 2007<br>
|
||||||
|
|
||||||
</b>
|
</b>
|
||||||
</center>
|
</center>
|
||||||
|
|
@ -59,12 +59,6 @@ Copies at most <tt>count</tt> parameters from the parameter list <tt>p</tt>.
|
||||||
Returns the total number of parameters in a parameter list.
|
Returns the total number of parameters in a parameter list.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>
|
|
||||||
<b><tt>int ParmList_numarg(ParmList *p)</tt></b>
|
|
||||||
<blockquote>
|
|
||||||
Returns the number of non-ignored parameters in a parameter list. Any parameter with an "ignore" attribute is ignored in the count.
|
|
||||||
</blockquote>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<b><tt>int ParmList_numrequired(ParmList *p)</tt></b>
|
<b><tt>int ParmList_numrequired(ParmList *p)</tt></b>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
|
@ -95,7 +89,7 @@ Creates a C prototype string of the parameters and includes the default values (
|
||||||
<p>
|
<p>
|
||||||
<b><tt>String *ParmList_protostr(ParmList *p)</tt></b>
|
<b><tt>String *ParmList_protostr(ParmList *p)</tt></b>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
Creates a C prototype string of the parameters. Does not include any hidden parameters.
|
Creates a C prototype string of the parameters.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1790,13 +1790,13 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s) ignored. Method %s(%s) const at %s:%d used.\n",
|
"Overloaded method %s(%s) ignored. Method %s(%s) const at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes[j].error = 1;
|
nodes[j].error = 1;
|
||||||
|
|
@ -1806,13 +1806,13 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s) const ignored. Method %s(%s) at %s:%d used.\n",
|
"Overloaded method %s(%s) const ignored. Method %s(%s) at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes[j].error = 1;
|
nodes[j].error = 1;
|
||||||
|
|
@ -1827,17 +1827,17 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s)%s is shadowed by %s(%s)%s at %s:%d.\n",
|
"Overloaded %s(%s)%s is shadowed by %s(%s)%s at %s:%d.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms),
|
||||||
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s)%s ignored. Method %s(%s)%s at %s:%d used.\n",
|
"Overloaded method %s(%s)%s ignored. Method %s(%s)%s at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms),
|
||||||
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
nodes[j].error = 1;
|
nodes[j].error = 1;
|
||||||
|
|
@ -1854,7 +1854,7 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (nodes[i].error)
|
if (nodes[i].error)
|
||||||
Setattr(nodes[i].n, "overload:ignore", "1");
|
Setattr(nodes[i].n, "overload:ignore", "1");
|
||||||
Append(result, nodes[i].n);
|
Append(result, nodes[i].n);
|
||||||
// Printf(stdout,"[ %d ] %s\n", i, ParmList_protostr(nodes[i].parms));
|
// Printf(stdout,"[ %d ] %s\n", i, ParmList_errorstr(nodes[i].parms));
|
||||||
// Swig_print_node(nodes[i].n);
|
// Swig_print_node(nodes[i].n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ void emit_attach_parmmaps(ParmList *l, Wrapper *f) {
|
||||||
Printv(f->code, tm, "\n", NIL);
|
Printv(f->code, tm, "\n", NIL);
|
||||||
np = Getattr(p, "tmap:in:next");
|
np = Getattr(p, "tmap:in:next");
|
||||||
while (p && (p != np)) {
|
while (p && (p != np)) {
|
||||||
Setattr(p, "ignore", "1");
|
/* Setattr(p,"ignore","1"); Deprecate */
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
}
|
}
|
||||||
} else if (tm) {
|
} else if (tm) {
|
||||||
|
|
|
||||||
|
|
@ -224,13 +224,13 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s) ignored. Method %s(%s) const at %s:%d used.\n",
|
"Overloaded method %s(%s) ignored. Method %s(%s) const at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes[j].error = 1;
|
nodes[j].error = 1;
|
||||||
|
|
@ -240,13 +240,13 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s) const ignored. Method %s(%s) at %s:%d used.\n",
|
"Overloaded method %s(%s) const ignored. Method %s(%s) at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms), Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes[j].error = 1;
|
nodes[j].error = 1;
|
||||||
|
|
@ -261,17 +261,17 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s)%s is shadowed by %s(%s)%s at %s:%d.\n",
|
"Overloaded %s(%s)%s is shadowed by %s(%s)%s at %s:%d.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms),
|
||||||
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s)%s ignored. Method %s(%s)%s at %s:%d used.\n",
|
"Overloaded method %s(%s)%s ignored. Method %s(%s)%s at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n, "name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n, "name"), ParmList_errorstr(nodes[j].parms),
|
||||||
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[j].n, "decl")) ? " const" : "",
|
||||||
Getattr(nodes[i].n, "name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n, "name"), ParmList_errorstr(nodes[i].parms),
|
||||||
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
SwigType_isconst(Getattr(nodes[i].n, "decl")) ? " const" : "", Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
nodes[j].error = 1;
|
nodes[j].error = 1;
|
||||||
|
|
@ -288,7 +288,7 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
||||||
if (nodes[i].error)
|
if (nodes[i].error)
|
||||||
Setattr(nodes[i].n, "overload:ignore", "1");
|
Setattr(nodes[i].n, "overload:ignore", "1");
|
||||||
Append(result, nodes[i].n);
|
Append(result, nodes[i].n);
|
||||||
// Printf(stdout,"[ %d ] %s\n", i, ParmList_protostr(nodes[i].parms));
|
// Printf(stdout,"[ %d ] %s\n", i, ParmList_errorstr(nodes[i].parms));
|
||||||
// Swig_print_node(nodes[i].n);
|
// Swig_print_node(nodes[i].n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -974,7 +974,7 @@ public:
|
||||||
while (p != 0) {
|
while (p != 0) {
|
||||||
SwigType *pt = Getattr(p, "type");
|
SwigType *pt = Getattr(p, "type");
|
||||||
String *pn = Getattr(p, "name");
|
String *pn = Getattr(p, "name");
|
||||||
if (!Getattr(p, "ignore")) {
|
if (!checkAttribute(p,"tmap:in:numinputs","0")) {
|
||||||
/* If parameter has been named, use that. Otherwise, just print a type */
|
/* If parameter has been named, use that. Otherwise, just print a type */
|
||||||
if (SwigType_type(pt) != T_VOID) {
|
if (SwigType_type(pt) != T_VOID) {
|
||||||
if (Len(pn) > 0) {
|
if (Len(pn) > 0) {
|
||||||
|
|
@ -986,12 +986,12 @@ public:
|
||||||
i++;
|
i++;
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
if (p)
|
if (p)
|
||||||
if (!Getattr(p, "ignore"))
|
if (!checkAttribute(p,"tmap:in:numinputs","0"))
|
||||||
Putc(',', temp);
|
Putc(',', temp);
|
||||||
} else {
|
} else {
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
if (p)
|
if (p)
|
||||||
if ((i > 0) && (!Getattr(p, "ignore")))
|
if ((i > 0) && (!checkAttribute(p,"tmap:in:numinputs","0")))
|
||||||
Putc(',', temp);
|
Putc(',', temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1706,7 +1706,7 @@ public:
|
||||||
if (Len(pn)) {
|
if (Len(pn)) {
|
||||||
String *tmp = 0;
|
String *tmp = 0;
|
||||||
String *name = pn;
|
String *name = pn;
|
||||||
if (!Getattr(p, "hidden")) {
|
if (!Getattr(p,"hidden")) {
|
||||||
name = tmp = Swig_name_make(p, 0, pn, 0, 0);
|
name = tmp = Swig_name_make(p, 0, pn, 0, 0);
|
||||||
}
|
}
|
||||||
Printf(kwargs, "(char *) \"%s\",", name);
|
Printf(kwargs, "(char *) \"%s\",", name);
|
||||||
|
|
@ -1739,7 +1739,7 @@ public:
|
||||||
|
|
||||||
if (Getattr(p, "tmap:in:implicitconv")) {
|
if (Getattr(p, "tmap:in:implicitconv")) {
|
||||||
const char *convflag = "0";
|
const char *convflag = "0";
|
||||||
if (!Getattr(p, "hidden")) {
|
if (!Getattr(p,"hidden")) {
|
||||||
SwigType *ptype = Getattr(p, "type");
|
SwigType *ptype = Getattr(p, "type");
|
||||||
convflag = get_implicitconv_flag(classLookup(ptype));
|
convflag = get_implicitconv_flag(classLookup(ptype));
|
||||||
}
|
}
|
||||||
|
|
@ -1842,7 +1842,7 @@ public:
|
||||||
if (!Getattr(p, "tmap:in:parse") && (tm = Getattr(p, "tmap:freearg"))) {
|
if (!Getattr(p, "tmap:in:parse") && (tm = Getattr(p, "tmap:freearg"))) {
|
||||||
if (Getattr(p, "tmap:freearg:implicitconv")) {
|
if (Getattr(p, "tmap:freearg:implicitconv")) {
|
||||||
const char *convflag = "0";
|
const char *convflag = "0";
|
||||||
if (!Getattr(p, "hidden")) {
|
if (!Getattr(p,"hidden")) {
|
||||||
SwigType *ptype = Getattr(p, "type");
|
SwigType *ptype = Getattr(p, "type");
|
||||||
convflag = get_implicitconv_flag(classLookup(ptype));
|
convflag = get_implicitconv_flag(classLookup(ptype));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1451,14 +1451,14 @@ static List * Swig_overload_rank(Node *n,
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n,"name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n,"name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s) ignored. Method %s(%s) const at %s:%d used.\n",
|
"Overloaded method %s(%s) ignored. Method %s(%s) const at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n,"name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n,"name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getattr(nodes[i].n,"name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n,"name"), ParmList_errorstr(nodes[i].parms),
|
||||||
Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1469,14 +1469,14 @@ static List * Swig_overload_rank(Node *n,
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
"Overloaded %s(%s) const ignored. Non-const method at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n,"name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n,"name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s) const ignored. Method %s(%s) at %s:%d used.\n",
|
"Overloaded method %s(%s) const ignored. Method %s(%s) at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n,"name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n,"name"), ParmList_errorstr(nodes[j].parms),
|
||||||
Getattr(nodes[i].n,"name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n,"name"), ParmList_errorstr(nodes[i].parms),
|
||||||
Getfile(nodes[i].n), Getline(nodes[i].n));
|
Getfile(nodes[i].n), Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1492,18 +1492,18 @@ static List * Swig_overload_rank(Node *n,
|
||||||
if (script_lang_wrapping) {
|
if (script_lang_wrapping) {
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded %s(%s)%s is shadowed by %s(%s)%s at %s:%d.\n",
|
"Overloaded %s(%s)%s is shadowed by %s(%s)%s at %s:%d.\n",
|
||||||
Getattr(nodes[j].n,"name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n,"name"), ParmList_errorstr(nodes[j].parms),
|
||||||
SwigType_isconst(Getattr(nodes[j].n,"decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[j].n,"decl")) ? " const" : "",
|
||||||
Getattr(nodes[i].n,"name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n,"name"), ParmList_errorstr(nodes[i].parms),
|
||||||
SwigType_isconst(Getattr(nodes[i].n,"decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[i].n,"decl")) ? " const" : "",
|
||||||
Getfile(nodes[i].n),Getline(nodes[i].n));
|
Getfile(nodes[i].n),Getline(nodes[i].n));
|
||||||
} else {
|
} else {
|
||||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||||
"Overloaded method %s(%s)%s ignored. Method %s(%s)%s at %s:%d used.\n",
|
"Overloaded method %s(%s)%s ignored. Method %s(%s)%s at %s:%d used.\n",
|
||||||
Getattr(nodes[j].n,"name"), ParmList_protostr(nodes[j].parms),
|
Getattr(nodes[j].n,"name"), ParmList_errorstr(nodes[j].parms),
|
||||||
SwigType_isconst(Getattr(nodes[j].n,"decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[j].n,"decl")) ? " const" : "",
|
||||||
Getattr(nodes[i].n,"name"), ParmList_protostr(nodes[i].parms),
|
Getattr(nodes[i].n,"name"), ParmList_errorstr(nodes[i].parms),
|
||||||
SwigType_isconst(Getattr(nodes[i].n,"decl")) ? " const" : "",
|
SwigType_isconst(Getattr(nodes[i].n,"decl")) ? " const" : "",
|
||||||
Getfile(nodes[i].n),Getline(nodes[i].n));
|
Getfile(nodes[i].n),Getline(nodes[i].n));
|
||||||
}
|
}
|
||||||
|
|
@ -1521,7 +1521,7 @@ static List * Swig_overload_rank(Node *n,
|
||||||
if (nodes[i].error)
|
if (nodes[i].error)
|
||||||
Setattr(nodes[i].n, "overload:ignore", "1");
|
Setattr(nodes[i].n, "overload:ignore", "1");
|
||||||
Append(result,nodes[i].n);
|
Append(result,nodes[i].n);
|
||||||
// Printf(stdout,"[ %d ] %s\n", i, ParmList_protostr(nodes[i].parms));
|
// Printf(stdout,"[ %d ] %s\n", i, ParmList_errorstr(nodes[i].parms));
|
||||||
// Swig_print_node(nodes[i].n);
|
// Swig_print_node(nodes[i].n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -807,7 +807,7 @@ int Swig_MethodToFunction(Node *n, String *classname, int flags, SwigType *direc
|
||||||
SwigType_add_pointer(type);
|
SwigType_add_pointer(type);
|
||||||
p = NewParm(type, "self");
|
p = NewParm(type, "self");
|
||||||
Setattr(p, "self", "1");
|
Setattr(p, "self", "1");
|
||||||
Setattr(p, "hidden", "1");
|
Setattr(p, "hidden","1");
|
||||||
/*
|
/*
|
||||||
Disable the 'this' ownership in 'self' to manage inplace
|
Disable the 'this' ownership in 'self' to manage inplace
|
||||||
operations like:
|
operations like:
|
||||||
|
|
@ -1239,7 +1239,7 @@ int Swig_MembersetToFunction(Node *n, String *classname, int flags) {
|
||||||
SwigType_add_pointer(t);
|
SwigType_add_pointer(t);
|
||||||
parms = NewParm(t, "self");
|
parms = NewParm(t, "self");
|
||||||
Setattr(parms, "self", "1");
|
Setattr(parms, "self", "1");
|
||||||
Setattr(parms, "hidden", "1");
|
Setattr(parms, "hidden","1");
|
||||||
Delete(t);
|
Delete(t);
|
||||||
|
|
||||||
ty = Swig_wrapped_member_var_type(type, varcref);
|
ty = Swig_wrapped_member_var_type(type, varcref);
|
||||||
|
|
@ -1325,7 +1325,7 @@ int Swig_MembergetToFunction(Node *n, String *classname, int flags) {
|
||||||
SwigType_add_pointer(t);
|
SwigType_add_pointer(t);
|
||||||
parms = NewParm(t, "self");
|
parms = NewParm(t, "self");
|
||||||
Setattr(parms, "self", "1");
|
Setattr(parms, "self", "1");
|
||||||
Setattr(parms, "hidden", "1");
|
Setattr(parms, "hidden","1");
|
||||||
Delete(t);
|
Delete(t);
|
||||||
|
|
||||||
ty = Swig_wrapped_member_var_type(type, varcref);
|
ty = Swig_wrapped_member_var_type(type, varcref);
|
||||||
|
|
|
||||||
|
|
@ -68,3 +68,38 @@ int ParmList_is_compactdefargs(ParmList *p) {
|
||||||
|
|
||||||
return compactdefargs;
|
return compactdefargs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------
|
||||||
|
* ParmList_errorstr()
|
||||||
|
*
|
||||||
|
* Generate a prototype string suitable for use in error/warning messages.
|
||||||
|
* This function is aware of hidden parameters.
|
||||||
|
* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* Discussion. This function is used to generate error messages, but take
|
||||||
|
into account that there might be a hidden parameter. Although this involves
|
||||||
|
parameter lists, it really isn't a core feature of swigparm.h or parms.c.
|
||||||
|
This is because the "hidden" attribute of parameters is added elsewhere (cwrap.c).
|
||||||
|
|
||||||
|
For now, this function is placed here because it doesn't really seem to fit in
|
||||||
|
with the parms.c interface.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
String *ParmList_errorstr(ParmList *p) {
|
||||||
|
String *out = NewStringEmpty();
|
||||||
|
while (p) {
|
||||||
|
if (Getattr(p,"hidden")) {
|
||||||
|
p = nextSibling(p);
|
||||||
|
} else {
|
||||||
|
String *pstr = SwigType_str(Getattr(p, "type"), 0);
|
||||||
|
Append(out, pstr);
|
||||||
|
p = nextSibling(p);
|
||||||
|
if (p) {
|
||||||
|
Append(out, ",");
|
||||||
|
}
|
||||||
|
Delete(pstr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,20 +81,6 @@ ParmList *CopyParmList(ParmList *p) {
|
||||||
return CopyParmListMax(p,-1);
|
return CopyParmListMax(p,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------
|
|
||||||
* int ParmList_numarg()
|
|
||||||
* ------------------------------------------------------------------ */
|
|
||||||
|
|
||||||
int ParmList_numarg(ParmList *p) {
|
|
||||||
int n = 0;
|
|
||||||
while (p) {
|
|
||||||
if (!Getattr(p, "ignore"))
|
|
||||||
n++;
|
|
||||||
p = nextSibling(p);
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* int ParmList_numrequired(). Return number of required arguments
|
* int ParmList_numrequired(). Return number of required arguments
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
@ -181,17 +167,13 @@ String *ParmList_str_defaultargs(ParmList *p) {
|
||||||
String *ParmList_protostr(ParmList *p) {
|
String *ParmList_protostr(ParmList *p) {
|
||||||
String *out = NewStringEmpty();
|
String *out = NewStringEmpty();
|
||||||
while (p) {
|
while (p) {
|
||||||
if (Getattr(p, "hidden")) {
|
String *pstr = SwigType_str(Getattr(p, "type"), 0);
|
||||||
p = nextSibling(p);
|
Append(out, pstr);
|
||||||
} else {
|
p = nextSibling(p);
|
||||||
String *pstr = SwigType_str(Getattr(p, "type"), 0);
|
if (p) {
|
||||||
Append(out, pstr);
|
Append(out, ",");
|
||||||
p = nextSibling(p);
|
|
||||||
if (p) {
|
|
||||||
Append(out, ",");
|
|
||||||
}
|
|
||||||
Delete(pstr);
|
|
||||||
}
|
}
|
||||||
|
Delete(pstr);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -297,6 +297,9 @@ extern "C" {
|
||||||
|
|
||||||
#include "swigparm.h"
|
#include "swigparm.h"
|
||||||
|
|
||||||
|
extern String *ParmList_errorstr(ParmList *);
|
||||||
|
extern int ParmList_is_compactdefargs(ParmList *p);
|
||||||
|
|
||||||
/* --- Parse tree support --- */
|
/* --- Parse tree support --- */
|
||||||
|
|
||||||
#include "swigtree.h"
|
#include "swigtree.h"
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,12 @@ extern Parm *CopyParm(Parm *p);
|
||||||
extern ParmList *CopyParmList(ParmList *);
|
extern ParmList *CopyParmList(ParmList *);
|
||||||
extern ParmList *CopyParmListMax(ParmList *, int count);
|
extern ParmList *CopyParmListMax(ParmList *, int count);
|
||||||
extern int ParmList_len(ParmList *);
|
extern int ParmList_len(ParmList *);
|
||||||
extern int ParmList_numarg(ParmList *);
|
|
||||||
extern int ParmList_numrequired(ParmList *);
|
extern int ParmList_numrequired(ParmList *);
|
||||||
|
extern int ParmList_has_defaultargs(ParmList *p);
|
||||||
|
|
||||||
|
/* Output functions */
|
||||||
extern String *ParmList_str(ParmList *);
|
extern String *ParmList_str(ParmList *);
|
||||||
extern String *ParmList_str_defaultargs(ParmList *);
|
extern String *ParmList_str_defaultargs(ParmList *);
|
||||||
extern String *ParmList_protostr(ParmList *);
|
extern String *ParmList_protostr(ParmList *);
|
||||||
extern int ParmList_is_compactdefargs(ParmList *p);
|
|
||||||
extern int ParmList_has_defaultargs(ParmList *p);
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue