Fix unused parameter warnings in python when using gcc's -W -Wall options
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10547 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
600deef43d
commit
1213c5640a
2 changed files with 6 additions and 4 deletions
|
|
@ -1798,13 +1798,15 @@ void SwigType_inherit_equiv(File *out) {
|
|||
String *lprefix = SwigType_lstr(prefix, 0);
|
||||
Hash *subhash = Getattr(sub, bk.key);
|
||||
String *convcode = Getattr(subhash, "convcode");
|
||||
Printf(out, "static void *%s(void *x, int *newmemory) {", convname);
|
||||
if (convcode) {
|
||||
char *newmemoryused = Strstr(convcode, "newmemory"); /* see if newmemory parameter is used in order to avoid unused paramater warnings */
|
||||
String *fn = Copy(convcode);
|
||||
Replaceall(fn, "$from", "x");
|
||||
Printf(out, "static void *%s(void *x, int *%s) {", convname, newmemoryused ? "newmemory" : "");
|
||||
Printf(out, "%s", fn);
|
||||
} else {
|
||||
String *cast = Getattr(subhash, "cast");
|
||||
Printf(out, "static void *%s(void *x, int *) {", convname);
|
||||
Printf(out, "\n return (void *)((%s) ", lkey);
|
||||
if (cast)
|
||||
Printf(out, "%s", cast);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue