Add ability to suppress some director warnings by their method name, not just the containing class name
This commit is contained in:
parent
7b50640c05
commit
9d0b20916f
4 changed files with 14 additions and 10 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
%module(directors="1") director_basic
|
%module(directors="1") director_basic
|
||||||
#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR
|
|
||||||
|
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) MyClass::pmethod;
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
// Tests classes passed by value, pointer and reference
|
// Tests classes passed by value, pointer and reference
|
||||||
// Note: C# module has a large runtime test
|
// Note: C# module has a large runtime test
|
||||||
|
|
||||||
#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR
|
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) Base::Ref;
|
||||||
|
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) Base::Ptr;
|
||||||
|
|
||||||
%module(directors="1") director_classes
|
%module(directors="1") director_classes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
%module(directors="1") java_director_assumeoverride
|
%module(directors="1") java_director_assumeoverride
|
||||||
#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
class OverrideMe {
|
class OverrideMe {
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@ extern int AddExtern;
|
||||||
* ---------------------------------------------------------------------- */
|
* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
int Dispatcher::emit_one(Node *n) {
|
int Dispatcher::emit_one(Node *n) {
|
||||||
String *wrn;
|
|
||||||
int ret = SWIG_OK;
|
int ret = SWIG_OK;
|
||||||
|
|
||||||
char *tag = Char(nodeType(n));
|
char *tag = Char(nodeType(n));
|
||||||
|
|
@ -104,10 +103,9 @@ int Dispatcher::emit_one(Node *n) {
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
|
|
||||||
/* Look for warnings */
|
/* Look for warnings */
|
||||||
wrn = Getattr(n, "feature:warnfilter");
|
String *wrn = Getattr(n, "feature:warnfilter");
|
||||||
if (wrn) {
|
if (wrn)
|
||||||
Swig_warnfilter(wrn, 1);
|
Swig_warnfilter(wrn, 1);
|
||||||
}
|
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
* C/C++ parsing
|
* C/C++ parsing
|
||||||
|
|
@ -181,9 +179,8 @@ int Dispatcher::emit_one(Node *n) {
|
||||||
Swig_error(input_file, line_number, "Unrecognized parse tree node type '%s'\n", tag);
|
Swig_error(input_file, line_number, "Unrecognized parse tree node type '%s'\n", tag);
|
||||||
ret = SWIG_ERROR;
|
ret = SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (wrn) {
|
if (wrn)
|
||||||
Swig_warnfilter(wrn, 0);
|
Swig_warnfilter(wrn, 0);
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2063,6 +2060,10 @@ int Language::classDirectorMethods(Node *n) {
|
||||||
if (GetFlag(method, "feature:nodirector"))
|
if (GetFlag(method, "feature:nodirector"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
String *wrn = Getattr(method, "feature:warnfilter");
|
||||||
|
if (wrn)
|
||||||
|
Swig_warnfilter(wrn, 1);
|
||||||
|
|
||||||
String *type = Getattr(method, "nodeType");
|
String *type = Getattr(method, "nodeType");
|
||||||
if (!Cmp(type, "destructor")) {
|
if (!Cmp(type, "destructor")) {
|
||||||
classDirectorDestructor(method);
|
classDirectorDestructor(method);
|
||||||
|
|
@ -2074,6 +2075,8 @@ int Language::classDirectorMethods(Node *n) {
|
||||||
SetFlag(item, "director");
|
SetFlag(item, "director");
|
||||||
Swig_restore(method);
|
Swig_restore(method);
|
||||||
}
|
}
|
||||||
|
if (wrn)
|
||||||
|
Swig_warnfilter(wrn, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue