summaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2011-03-12 21:37:35 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2011-03-12 21:37:35 +0000
commit52e59d530d6fcb42981deb20c45e2f88ab956651 (patch)
tree2f6fa9f4b8e5ab4803278a3e77f174d0710cdad7 /Examples
parent669bc0e00123591553fe8d890dd29ffdb8188864 (diff)
downloadswig-52e59d530d6fcb42981deb20c45e2f88ab956651.tar.gz
gcc-4.5 warning fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12529 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples')
-rw-r--r--Examples/test-suite/default_arg_values.i12
1 files changed, 10 insertions, 2 deletions
diff --git a/Examples/test-suite/default_arg_values.i b/Examples/test-suite/default_arg_values.i
index e52375073..47ca2d12f 100644
--- a/Examples/test-suite/default_arg_values.i
+++ b/Examples/test-suite/default_arg_values.i
@@ -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; }
-%}