summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Examples/test-suite/default_args.i3
-rw-r--r--Examples/test-suite/director_enum.i2
-rw-r--r--Examples/test-suite/enum_thorough.i2
-rw-r--r--Examples/test-suite/friends.i1
-rw-r--r--Examples/test-suite/lextype.i6
-rw-r--r--Examples/test-suite/lib_std_vector.i10
-rw-r--r--Examples/test-suite/overload_extend.i2
-rw-r--r--Examples/test-suite/python/callback.i4
-rw-r--r--Examples/test-suite/redefined.i4
-rw-r--r--Examples/test-suite/template_array_numeric.i2
-rw-r--r--Examples/test-suite/template_base_template.i4
-rw-r--r--Examples/test-suite/template_ns4.i4
-rw-r--r--Examples/test-suite/template_tbase_template.i4
-rw-r--r--Examples/test-suite/using_private.i2
-rw-r--r--Examples/test-suite/using_protected.i2
-rw-r--r--Examples/test-suite/valuewrapper_opaque.i2
-rw-r--r--Source/Modules/csharp.cxx2
-rw-r--r--Source/Modules/java.cxx3
-rw-r--r--Source/Modules/modula3.cxx2
-rw-r--r--Source/Modules/python.cxx4
-rw-r--r--Source/Modules/ruby.cxx2
21 files changed, 40 insertions, 27 deletions
diff --git a/Examples/test-suite/default_args.i b/Examples/test-suite/default_args.i
index 4aabc837a..f72d9a99b 100644
--- a/Examples/test-suite/default_args.i
+++ b/Examples/test-suite/default_args.i
@@ -162,9 +162,10 @@ public:
char contrived(const char *c = &charvalue) { return *c; }
protected:
static const int intvalue = 2000;
- static const double doublevalue = 987.654;
+ static const double doublevalue;
};
const char Tricky::charvalue = 'X';
+const double Tricky::doublevalue = 987.654;
// tests default argument which is a constructor call within namespace
diff --git a/Examples/test-suite/director_enum.i b/Examples/test-suite/director_enum.i
index 9c315fdf5..78d56c3bd 100644
--- a/Examples/test-suite/director_enum.i
+++ b/Examples/test-suite/director_enum.i
@@ -12,7 +12,7 @@
%inline %{
namespace EnumDirector {
- class A;
+ struct A;
enum Hello {
hi, hello, yo, awright
diff --git a/Examples/test-suite/enum_thorough.i b/Examples/test-suite/enum_thorough.i
index 6e3edd430..ea775803b 100644
--- a/Examples/test-suite/enum_thorough.i
+++ b/Examples/test-suite/enum_thorough.i
@@ -442,11 +442,9 @@ namespace curly {
}
struct Obscure {
- enum {};
enum Zero {};
enum One {one};
enum Two {two, twoagain};
- typedef enum {};
typedef enum Empty {};
typedef enum {} AlsoEmpty;
};
diff --git a/Examples/test-suite/friends.i b/Examples/test-suite/friends.i
index 5ae6a7ce8..874b92783 100644
--- a/Examples/test-suite/friends.i
+++ b/Examples/test-suite/friends.i
@@ -9,6 +9,7 @@
%inline
%{
+ void globalscope(); // forward declaration needed for some compilers
struct A;
struct B
diff --git a/Examples/test-suite/lextype.i b/Examples/test-suite/lextype.i
index b96f49d78..a9a5fe097 100644
--- a/Examples/test-suite/lextype.i
+++ b/Examples/test-suite/lextype.i
@@ -12,7 +12,7 @@ behave appropriately for that particular species.
For this to work correctly however, it is critical that
there is a variable which strictly preserves the name
-of the type. '$lextype' doesn't currently do this -
+of the type. '$basetype' doesn't currently do this -
it sometimes contains 'Giraffe' and sometimes (specifically
the case of arrays) contains 'Animal'. Since existing
code may rely on that behaviour, we create a new variable
@@ -27,11 +27,13 @@ code is not functioning properly it will fail to compile.
%typemap(in) Animal ()
{
void *space_needed = malloc(HEIGHT_$1_lextype * WIDTH_$1_lextype);
+ $1 = 0;
}
%typemap(in) Animal[2] ()
{
void *space_needed = malloc(2 * HEIGHT_$1_lextype * WIDTH_$1_lextype);
+ $1 = 0;
}
%inline %{
@@ -44,6 +46,6 @@ typedef Animal Giraffe;
void eat(Giraffe g) {}
void drink(Giraffe *g) {}
-Giraffe mate(Giraffe g[2]) {}
+Giraffe mate(Giraffe g[2]) { return g[0]; }
%}
diff --git a/Examples/test-suite/lib_std_vector.i b/Examples/test-suite/lib_std_vector.i
index a494a2696..0f3d42d19 100644
--- a/Examples/test-suite/lib_std_vector.i
+++ b/Examples/test-suite/lib_std_vector.i
@@ -40,9 +40,19 @@ void halve_in_place(std::vector<double>& v) {
std::bind2nd(std::divides<double>(),2.0));
}
+struct Struct {
+ double num;
+ Struct() : num(0.0) {}
+ Struct(double d) : num(d) {}
+// bool operator==(const Struct &other) { return (num == other.num); }
+};
%}
+#ifndef SWIGCSHARP
+// Can't do vectors of pointers yet
%template(IntPtrVector) std::vector<int *>;
+#endif
+%template(StructVector) std::vector<Struct>;
diff --git a/Examples/test-suite/overload_extend.i b/Examples/test-suite/overload_extend.i
index f024a5c06..965f052d4 100644
--- a/Examples/test-suite/overload_extend.i
+++ b/Examples/test-suite/overload_extend.i
@@ -22,6 +22,7 @@
%inline %{
struct Foo {
+ int var;
#ifdef __cplusplus
int test() { return -1; }
#endif
@@ -49,6 +50,7 @@ struct Foo {
%inline %{
typedef struct {
+ int var;
} Bar;
%}
diff --git a/Examples/test-suite/python/callback.i b/Examples/test-suite/python/callback.i
index ac3ae1bfb..a71366439 100644
--- a/Examples/test-suite/python/callback.i
+++ b/Examples/test-suite/python/callback.i
@@ -30,11 +30,11 @@
};
- int foobar(int a, int (*pf)(int a)) {
+ extern "C" int foobar(int a, int (*pf)(int a)) {
return pf(a);
}
- int foobarm(int a, A ap, int (A::*pf)(int a)) {
+ extern "C" int foobarm(int a, A ap, int (A::*pf)(int a)) {
return (ap.*pf)(a);
}
diff --git a/Examples/test-suite/redefined.i b/Examples/test-suite/redefined.i
index 7d78dd98b..a97de66e0 100644
--- a/Examples/test-suite/redefined.i
+++ b/Examples/test-suite/redefined.i
@@ -36,8 +36,8 @@
typedef int Int;
typedef int Int;
- int hello(int);
- inline int hello(int) { return 0; }
+ inline int hello(int);
+ int hello(int) { return 0; }
struct B;
diff --git a/Examples/test-suite/template_array_numeric.i b/Examples/test-suite/template_array_numeric.i
index 72340c59a..463b04ac1 100644
--- a/Examples/test-suite/template_array_numeric.i
+++ b/Examples/test-suite/template_array_numeric.i
@@ -1,7 +1,5 @@
%module template_array_numeric
-%typemap(arginit) const float[ANY] (float temp[$1_dim0]) { }
-
%inline %{
template <int Len>
diff --git a/Examples/test-suite/template_base_template.i b/Examples/test-suite/template_base_template.i
index 7344263c1..1191764cc 100644
--- a/Examples/test-suite/template_base_template.i
+++ b/Examples/test-suite/template_base_template.i
@@ -27,8 +27,8 @@
%}
%{
- template class Function <double, double>;
- template class Class <double, double>;
+ template struct Function <double, double>;
+ template struct Class <double, double>;
%}
%template(traits_dd) traits <double, double>;
diff --git a/Examples/test-suite/template_ns4.i b/Examples/test-suite/template_ns4.i
index f77f149d7..34489c473 100644
--- a/Examples/test-suite/template_ns4.i
+++ b/Examples/test-suite/template_ns4.i
@@ -58,8 +58,8 @@
%{
namespace hello {
- template class Function <Double, Double>;
- template class ArithFunction <Double, Double>;
+ template struct Function <Double, Double>;
+ template struct ArithFunction <Double, Double>;
template class Class <Double, Double>;
}
%}
diff --git a/Examples/test-suite/template_tbase_template.i b/Examples/test-suite/template_tbase_template.i
index db241b52c..3cbdd0949 100644
--- a/Examples/test-suite/template_tbase_template.i
+++ b/Examples/test-suite/template_tbase_template.i
@@ -39,8 +39,8 @@
%}
%{
- template class Function <Double, Double>;
- template class Class <Double, Double>;
+ template struct Function <Double, Double>;
+ template struct Class <Double, Double>;
%}
%template(traits_dd) traits <Double, Double>;
diff --git a/Examples/test-suite/using_private.i b/Examples/test-suite/using_private.i
index 9cf0dee48..7b9cef819 100644
--- a/Examples/test-suite/using_private.i
+++ b/Examples/test-suite/using_private.i
@@ -4,7 +4,7 @@
class Foo {
public:
int x;
- int blah(int x) { return x; }
+ int blah(int xx) { return xx; }
int defaulted(int i = -1) { return i; }
};
diff --git a/Examples/test-suite/using_protected.i b/Examples/test-suite/using_protected.i
index 93d48cb49..23adfdbba 100644
--- a/Examples/test-suite/using_protected.i
+++ b/Examples/test-suite/using_protected.i
@@ -4,7 +4,7 @@
class Foo {
protected:
int x;
- int blah(int x) { return x; }
+ int blah(int xx) { return xx; }
};
class FooBar : public Foo {
diff --git a/Examples/test-suite/valuewrapper_opaque.i b/Examples/test-suite/valuewrapper_opaque.i
index 58660919c..52da89391 100644
--- a/Examples/test-suite/valuewrapper_opaque.i
+++ b/Examples/test-suite/valuewrapper_opaque.i
@@ -131,7 +131,7 @@ class BB {
friend class AA;
protected:
- BB(int a) { this->a = a; };
+ BB(int aa) { this->a = aa; };
BB() {};
int a;
diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx
index e429df1e4..d007ddf1a 100644
--- a/Source/Modules/csharp.cxx
+++ b/Source/Modules/csharp.cxx
@@ -414,7 +414,7 @@ class CSHARP : public Language {
void emitBanner(File *f) {
Printf(f, "/* ----------------------------------------------------------------------------\n");
Printf(f, " * This file was automatically generated by SWIG (http://www.swig.org).\n");
- Printf(f, " * Version: %s\n", PACKAGE_VERSION);
+ Printf(f, " * Version %s\n", PACKAGE_VERSION);
Printf(f, " *\n");
Printf(f, " * Do not make changes to this file unless you know what you are doing--modify\n");
Printf(f, " * the SWIG interface file instead.\n");
diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx
index 982732b99..57121f350 100644
--- a/Source/Modules/java.cxx
+++ b/Source/Modules/java.cxx
@@ -600,7 +600,7 @@ class JAVA : public Language {
void emitBanner(File *f) {
Printf(f, "/* ----------------------------------------------------------------------------\n");
Printf(f, " * This file was automatically generated by SWIG (http://www.swig.org).\n");
- Printf(f, " * Version: %s\n", PACKAGE_VERSION);
+ Printf(f, " * Version %s\n", PACKAGE_VERSION);
Printf(f, " *\n");
Printf(f, " * Do not make changes to this file unless you know what you are doing--modify\n");
Printf(f, " * the SWIG interface file instead.\n");
@@ -2063,6 +2063,7 @@ class JAVA : public Language {
Printf(conn_wrap->def, "JNIEXPORT void JNICALL Java_%s%s_%s(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg) {",
jnipackage, jni_imclass_name, swig_director_connect_jni);
Printf(conn_wrap->code, " %s *obj = *((%s **) &objarg);\n", norm_name, norm_name);
+ Printf(conn_wrap->code, " (void)jcls;\n");
Printf(conn_wrap->code, " SwigDirector_%s *director = dynamic_cast<SwigDirector_%s *>(obj);\n",
Getattr(n, "sym:name"), Getattr(n, "sym:name"));
Printf(conn_wrap->code, " if (director) {\n");
diff --git a/Source/Modules/modula3.cxx b/Source/Modules/modula3.cxx
index cf95f4540..7f5106f56 100644
--- a/Source/Modules/modula3.cxx
+++ b/Source/Modules/modula3.cxx
@@ -1236,7 +1236,7 @@ MODULA3 ():
Printf (f, "\
(*******************************************************************************\n\
* This file was automatically generated by SWIG (http://www.swig.org/).\n\
- * Version: %s\n\
+ * Version %s\n\
*\n\
* Do not make changes to this file unless you know what you are doing --\n\
* modify the SWIG interface file instead.\n\
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx
index c319b6509..25474fc7e 100644
--- a/Source/Modules/python.cxx
+++ b/Source/Modules/python.cxx
@@ -1025,11 +1025,11 @@ public:
if (n && Getattr(n,"feature:callback")) {
if (have_docstring(n)) {
- Printf(methods,"\"%s\\nswig_ptr: %s\"",
+ Printf(methods,"(char *)\"%s\\nswig_ptr: %s\"",
docstring(n, AUTODOC_FUNC, "", false),
Getattr(n,"feature:callback:name"));
} else {
- Printf(methods,"\"swig_ptr: %s\"",Getattr(n,"feature:callback:name"));
+ Printf(methods,"(char *)\"swig_ptr: %s\"",Getattr(n,"feature:callback:name"));
}
} else {
Printf(methods,"NULL");
diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx
index 5db4dbbd0..1037d865a 100644
--- a/Source/Modules/ruby.cxx
+++ b/Source/Modules/ruby.cxx
@@ -1003,7 +1003,7 @@ public:
int numarg = emit_num_arguments(l);
int numreq = emit_num_required(l);
int varargs = emit_isvarargs(l);
- bool allow_kwargs = Getattr(n,"feature:kwargs");
+ bool allow_kwargs = Getattr(n,"feature:kwargs") ? true : false;
bool use_director = (current == CONSTRUCTOR_INITIALIZE && Swig_directorclass(n));
int start = (current == MEMBER_FUNC || current == MEMBER_VAR || use_director) ? 1 : 0;