[Python] Deal with an integer as the default value of a bool
parameter in the C++ prototype. Fixes github #327, reported by Greg Allen.
This commit is contained in:
parent
c2a13b9b7b
commit
c2972b8bf0
4 changed files with 18 additions and 0 deletions
|
|
@ -6,6 +6,8 @@ struct Display {
|
|||
// 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; }
|
||||
bool bool0(bool x = 0) { return x; }
|
||||
bool bool1(bool x = 1) { return x; }
|
||||
};
|
||||
float* createPtr(float v) { static float val; val = v; return &val; }
|
||||
%}
|
||||
|
|
@ -14,5 +16,7 @@ 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; }
|
||||
bool bool0(bool x = 0) { return x; }
|
||||
bool bool1(bool x = 1) { return x; }
|
||||
};
|
||||
float* createPtr(float v) { static float val; val = v; return &val; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue