PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/default_arg_values.i

#
Swig | 18 lines | 16 code | 2 blank | 0 comment | 0 complexity | 0d4b67fc738c04bd24605656f4c374d6 MD5 | raw file
 1%module default_arg_values
 2
 3%{
 4struct Display {
 5  // Some compilers warn about 'float v = NULL', so only SWIG sees this peculiarity
 6  // Bad Python wrappers were being generated when NULL used for primitive type
 7  float draw1(float v = 0) { return v; }
 8  float draw2(float *v = 0) { return v ? *v : 0; }
 9};
10float* createPtr(float v) { static float val; val = v; return &val; }
11%}
12
13struct Display {
14  // Bad Python wrappers were being generated when NULL used for primitive type
15  float draw1(float v = NULL) { return v; }
16  float draw2(float *v = NULL) { return v ? *v : 0; }
17};
18float* createPtr(float v) { static float val; val = v; return &val; }