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:
William S Fulton 2011-03-12 21:37:35 +00:00
commit 52e59d530d

View file

@ -1,10 +1,18 @@
%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 {
// Bad Python wrappers were being generated when NULL used for primitive type
float draw1(float v = NULL) { return v; }
float draw2(float *v = NULL) { return v ? *v : 0; }
};
float* createPtr(float v) { static float val; val = v; return &val; }
%}