fixed dirprot member detection and add code to detect when a node need to checked for kw warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5620 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a5740e3de1
commit
89b8bdc89e
1 changed files with 31 additions and 1 deletions
|
|
@ -99,7 +99,8 @@ int need_protected(Node* n, int dirprot_mode)
|
||||||
if (!(Swig_need_protected() || dirprot_mode)) return 0;
|
if (!(Swig_need_protected() || dirprot_mode)) return 0;
|
||||||
|
|
||||||
/* First, 'n' looks like a function */
|
/* First, 'n' looks like a function */
|
||||||
if (SwigType_isfunction(Getattr(n,"decl"))) {
|
if ((Strcmp(nodeType(n),"cdecl") == 0) &&
|
||||||
|
SwigType_isfunction(Getattr(n,"decl"))) {
|
||||||
String *storage = Getattr(n,"storage");
|
String *storage = Getattr(n,"storage");
|
||||||
/* and the function is declared like virtual, or it has no
|
/* and the function is declared like virtual, or it has no
|
||||||
storage. This eliminates typedef, static and so on. */
|
storage. This eliminates typedef, static and so on. */
|
||||||
|
|
@ -107,3 +108,32 @@ int need_protected(Node* n, int dirprot_mode)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------------------
|
||||||
|
* int need_name_warning(Node *n)
|
||||||
|
*
|
||||||
|
* Detects if a node needs name warnings
|
||||||
|
*
|
||||||
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int need_name_warning(Node *n)
|
||||||
|
{
|
||||||
|
int need = 1;
|
||||||
|
/*
|
||||||
|
we don't use name warnings for:
|
||||||
|
- class forwards, no symbol is generated at the target language.
|
||||||
|
- template declarations, only for real instances using %template(name).
|
||||||
|
- typedefs, they have no effect at the target language.
|
||||||
|
*/
|
||||||
|
if (Strcmp(nodeType(n),"classforward") == 0) {
|
||||||
|
need = 0;
|
||||||
|
} else if (Getattr(n,"templatetype")) {
|
||||||
|
need = 0;
|
||||||
|
} else {
|
||||||
|
String *storage = Getattr(n,"storage");
|
||||||
|
if (storage && (Strcmp(storage,"typedef") == 0)) {
|
||||||
|
need = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return need;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue