Compiler warning fixes in testcases

This commit is contained in:
William S Fulton 2014-03-15 18:24:01 +00:00
commit e2b6de8a03
4 changed files with 23 additions and 13 deletions

View file

@ -80,6 +80,7 @@
// throws typemaps for c++->java exception conversions
%typemap(throws,throws="MyJavaException1") MyNS::Exception1 %{
(void)$1;
jclass excpcls = jenv->FindClass("java_director_exception_feature/MyJavaException1");
if (excpcls) {
jenv->ThrowNew(excpcls, $1.what());
@ -88,6 +89,7 @@
%}
%typemap(throws,throws="MyJavaException1") int %{
(void)$1;
jclass excpcls = jenv->FindClass("java_director_exception_feature/MyJavaException1");
if (excpcls) {
jenv->ThrowNew(excpcls, "Threw some integer");

View file

@ -95,6 +95,7 @@
%}
%typemap(throws,throws=PACKAGEDOT"MyNS.MyJavaException1") int %{
(void)$1;
jclass excpcls = jenv->FindClass(PACKAGESLASH"MyNS/MyJavaException1");
if (excpcls) {
jenv->ThrowNew(excpcls, "Threw some integer");

View file

@ -7,10 +7,11 @@
/* do nothing */
}
%typemap(out) Integer1
{
/* do nothing */
}
#ifdef SWIGCSHARP
%typemap(out) Integer1 { /* do nothing */ $result = 0; }
#else
%typemap(out) Integer1 { /* do nothing */ }
#endif
%typemap(in) Integer2
{
@ -18,10 +19,11 @@
/* do nothing */
}
%typemap(out) Integer2
{
/* do nothing */
}
#ifdef SWIGCSHARP
%typemap(out) Integer2 { /* do nothing */ $result = 0; }
#else
%typemap(out) Integer2 { /* do nothing */ }
#endif
%{
typedef int Integer1;

View file

@ -55,14 +55,19 @@ void foo2(Foo<short> f, const Foo<short>& ff) {}
};
}
#ifdef SWIGCSHARP
#define TYPEMAP_OUT_INIT $result = 0;
#else
#define TYPEMAP_OUT_INIT
#endif
// Test obscure bug where named typemaps where not being applied when symbol name contained a number
%typemap(out) double "_typemap_for_double_no_compile_"
%typemap(out) double ABCD::meth "$1 = 0.0;"
%typemap(out) double ABCD::m1 "$1 = 0.0;"
%typemap(out) double ABCD::_x2 "$1 = 0.0;"
%typemap(out) double ABCD::y_ "$1 = 0.0;"
%typemap(out) double ABCD::_3 "$1 = 0.0;"
%typemap(out) double ABCD::meth {$1 = 0.0; TYPEMAP_OUT_INIT}
%typemap(out) double ABCD::m1 {$1 = 0.0; TYPEMAP_OUT_INIT}
%typemap(out) double ABCD::_x2 {$1 = 0.0; TYPEMAP_OUT_INIT}
%typemap(out) double ABCD::y_ {$1 = 0.0; TYPEMAP_OUT_INIT}
%typemap(out) double ABCD::_3 {$1 = 0.0; TYPEMAP_OUT_INIT}
%inline %{
struct ABCD {
double meth() { return 0.0; }