gcc-4.5 warning fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12529 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
669bc0e001
commit
52e59d530d
1 changed files with 10 additions and 2 deletions
|
|
@ -1,10 +1,18 @@
|
||||||
%module default_arg_values
|
%module default_arg_values
|
||||||
|
|
||||||
%inline %{
|
%{
|
||||||
|
struct Display {
|
||||||
|
// Some compilers warn about 'float v = NULL', so only SWIG sees this peculiarity
|
||||||
|
// Bad Python wrappers were being generated when NULL used for primitive type
|
||||||
|
float draw1(float v = 0) { return v; }
|
||||||
|
float draw2(float *v = 0) { return v ? *v : 0; }
|
||||||
|
};
|
||||||
|
float* createPtr(float v) { static float val; val = v; return &val; }
|
||||||
|
%}
|
||||||
|
|
||||||
struct Display {
|
struct Display {
|
||||||
// Bad Python wrappers were being generated when NULL used for primitive type
|
// Bad Python wrappers were being generated when NULL used for primitive type
|
||||||
float draw1(float v = NULL) { return v; }
|
float draw1(float v = NULL) { return v; }
|
||||||
float draw2(float *v = NULL) { return v ? *v : 0; }
|
float draw2(float *v = NULL) { return v ? *v : 0; }
|
||||||
};
|
};
|
||||||
float* createPtr(float v) { static float val; val = v; return &val; }
|
float* createPtr(float v) { static float val; val = v; return &val; }
|
||||||
%}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue