Consistent warning 470 across all languages
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7123 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c07de8d45f
commit
1b00d2e007
5 changed files with 8 additions and 5 deletions
|
|
@ -425,7 +425,7 @@ example.i(4): Syntax error in input.
|
||||||
<li>467. Overloaded <em>declaration</em> not supported (no type checking rule for '<em>type</em>')
|
<li>467. Overloaded <em>declaration</em> not supported (no type checking rule for '<em>type</em>')
|
||||||
<li>468. No 'throw' typemap defined for exception type <em>type</em>
|
<li>468. No 'throw' typemap defined for exception type <em>type</em>
|
||||||
<li>469. No or improper directorin typemap defined for <em>type</em>
|
<li>469. No or improper directorin typemap defined for <em>type</em>
|
||||||
<li>470. Possible thread/reentrant unsafe wrapping
|
<li>470. Thread/reentrant unsafe wrapping, consider returning by value instead.
|
||||||
<li>471. Unable to use return type <em>type</em> in director method
|
<li>471. Unable to use return type <em>type</em> in director method
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class string;
|
||||||
$1 = &$1_str;
|
$1 = &$1_str;
|
||||||
jenv->ReleaseStringUTFChars($input, $1_pstr); %}
|
jenv->ReleaseStringUTFChars($input, $1_pstr); %}
|
||||||
|
|
||||||
%typemap(directorout,warning="470:Possible thread/reentrant unsafe wrapping, consider using a plain 'const string' or 'string' return type instead.") const string &
|
%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const string &
|
||||||
%{if(!$input) {
|
%{if(!$input) {
|
||||||
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::string");
|
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::string");
|
||||||
return $null;
|
return $null;
|
||||||
|
|
@ -216,7 +216,7 @@ class wstring;
|
||||||
%typemap(javadirectorin) const wstring & "$jniinput"
|
%typemap(javadirectorin) const wstring & "$jniinput"
|
||||||
%typemap(javadirectorout) const wstring & "$javacall"
|
%typemap(javadirectorout) const wstring & "$javacall"
|
||||||
|
|
||||||
%typemap(directorout,warning="470:Possible thread/reentrant unsafe wrapping, consider using a plain 'const wstring' or 'wstring' return type instead.") const wstring &
|
%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const wstring &
|
||||||
%{if(!$input) {
|
%{if(!$input) {
|
||||||
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring");
|
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring");
|
||||||
return $null;
|
return $null;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
if (res == SWIG_NEWOBJ) delete ptr;
|
if (res == SWIG_NEWOBJ) delete ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
%typemap(directorout,fragment=pyfrag,warning="470:Possible thread/reentrant unsafe wrapping, consider using a plain '"#Type"' return type instead.") const Type& {
|
%typemap(directorout,fragment=pyfrag,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const Type& {
|
||||||
Type *ptr = 0;
|
Type *ptr = 0;
|
||||||
int res = $input ? asptr_meth($input, &ptr) : 0;
|
int res = $input ? asptr_meth($input, &ptr) : 0;
|
||||||
if (!res || !ptr)
|
if (!res || !ptr)
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
if (!$input || PyErr_Occurred())
|
if (!$input || PyErr_Occurred())
|
||||||
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using as_meth.");
|
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using as_meth.");
|
||||||
}
|
}
|
||||||
%typemap(directorout,fragment=pyfrag,warning="470:Using thread/reentrant unsafe wrapping, consider using a plain '"#Type"' return type instead.") const Type& {
|
%typemap(directorout,fragment=pyfrag,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const Type& {
|
||||||
if ($input) {
|
if ($input) {
|
||||||
static $basetype temp = SWIG_static_cast(SWIG_arg(as_meth($input)),$basetype);
|
static $basetype temp = SWIG_static_cast(SWIG_arg(as_meth($input)),$basetype);
|
||||||
$result = &temp;
|
$result = &temp;
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,9 @@
|
||||||
/* Warnings */
|
/* Warnings */
|
||||||
#define %warnfilter(...) %feature("warnfilter",`__VA_ARGS__`)
|
#define %warnfilter(...) %feature("warnfilter",`__VA_ARGS__`)
|
||||||
|
|
||||||
|
/* Warnings used in typemaps. Macro names are the same as those in swigwarn.h but prefixed by SWIG_. */
|
||||||
|
%define SWIG_WARN_TYPEMAP_THREAD_UNSAFE "470:Thread/reentrant unsafe wrapping, consider returning by value instead." %enddef
|
||||||
|
|
||||||
/* Contract support - Experimental and undocumented */
|
/* Contract support - Experimental and undocumented */
|
||||||
|
|
||||||
#define %contract %feature("contract")
|
#define %contract %feature("contract")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue