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
|
|
@ -38,18 +38,18 @@ namespace swig {
|
||||||
virtual PySwigIterator *incr(size_t n = 1) = 0;
|
virtual PySwigIterator *incr(size_t n = 1) = 0;
|
||||||
|
|
||||||
// Backward iterator method, very common in C++, but not required in Python
|
// Backward iterator method, very common in C++, but not required in Python
|
||||||
virtual PySwigIterator *decr(size_t n = 1)
|
virtual PySwigIterator *decr(size_t /*n*/ = 1)
|
||||||
{
|
{
|
||||||
throw stop_iteration();
|
throw stop_iteration();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Random access iterator methods, but not required in Python
|
// Random access iterator methods, but not required in Python
|
||||||
virtual ptrdiff_t distance(const PySwigIterator &x) const
|
virtual ptrdiff_t distance(const PySwigIterator &/*x*/) const
|
||||||
{
|
{
|
||||||
throw std::invalid_argument("operation not supported");
|
throw std::invalid_argument("operation not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool equal (const PySwigIterator &x) const
|
virtual bool equal (const PySwigIterator &/*x*/) const
|
||||||
{
|
{
|
||||||
throw std::invalid_argument("operation not supported");
|
throw std::invalid_argument("operation not supported");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1798,13 +1798,15 @@ void SwigType_inherit_equiv(File *out) {
|
||||||
String *lprefix = SwigType_lstr(prefix, 0);
|
String *lprefix = SwigType_lstr(prefix, 0);
|
||||||
Hash *subhash = Getattr(sub, bk.key);
|
Hash *subhash = Getattr(sub, bk.key);
|
||||||
String *convcode = Getattr(subhash, "convcode");
|
String *convcode = Getattr(subhash, "convcode");
|
||||||
Printf(out, "static void *%s(void *x, int *newmemory) {", convname);
|
|
||||||
if (convcode) {
|
if (convcode) {
|
||||||
|
char *newmemoryused = Strstr(convcode, "newmemory"); /* see if newmemory parameter is used in order to avoid unused paramater warnings */
|
||||||
String *fn = Copy(convcode);
|
String *fn = Copy(convcode);
|
||||||
Replaceall(fn, "$from", "x");
|
Replaceall(fn, "$from", "x");
|
||||||
|
Printf(out, "static void *%s(void *x, int *%s) {", convname, newmemoryused ? "newmemory" : "");
|
||||||
Printf(out, "%s", fn);
|
Printf(out, "%s", fn);
|
||||||
} else {
|
} else {
|
||||||
String *cast = Getattr(subhash, "cast");
|
String *cast = Getattr(subhash, "cast");
|
||||||
|
Printf(out, "static void *%s(void *x, int *) {", convname);
|
||||||
Printf(out, "\n return (void *)((%s) ", lkey);
|
Printf(out, "\n return (void *)((%s) ", lkey);
|
||||||
if (cast)
|
if (cast)
|
||||||
Printf(out, "%s", cast);
|
Printf(out, "%s", cast);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue