various fixes to remove warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6580 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bf0fe7f7de
commit
11d77ef9ae
21 changed files with 41 additions and 28 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
%inline %{
|
||||
namespace EnumDirector {
|
||||
class A;
|
||||
struct A;
|
||||
|
||||
enum Hello {
|
||||
hi, hello, yo, awright
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
%inline
|
||||
%{
|
||||
|
||||
void globalscope(); // forward declaration needed for some compilers
|
||||
|
||||
struct A;
|
||||
struct B
|
||||
|
|
|
|||
|
|
@ -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]; }
|
||||
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
%module template_array_numeric
|
||||
|
||||
%typemap(arginit) const float[ANY] (float temp[$1_dim0]) { }
|
||||
|
||||
%inline %{
|
||||
|
||||
template <int Len>
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
}
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue