Fix regression in introduced in merge of C++11 strongly typed enums support

- Guile constants bad casts generated
- Go non-public enum value wrappers assert failure

Also cosmetic test comment correction
This commit is contained in:
William S Fulton 2014-12-07 20:27:29 +00:00
commit 7f8bb02d78
3 changed files with 5 additions and 7 deletions

View file

@ -1959,12 +1959,13 @@ private:
* ------------------------------------------------------------------------ */
virtual int enumvalueDeclaration(Node *n) {
Swig_require("enumvalueDeclaration", n, "*sym:name", NIL);
Node *parent = parentNode(n);
if (!is_public(n)) {
return SWIG_OK;
}
Swig_require("enumvalueDeclaration", n, "*sym:name", NIL);
Node *parent = parentNode(n);
if (Getattr(parent, "unnamed")) {
Setattr(n, "type", NewString("int"));
} else {

View file

@ -1350,7 +1350,7 @@ public:
Printv(f_header, tm, "\n", NIL);
} else {
// Create variable and assign it a value
Printf(f_header, "static %s = (%s)%s;\n", SwigType_str(type, var_name), type, rvalue);
Printf(f_header, "static %s = (%s)(%s);\n", SwigType_str(type, var_name), SwigType_str(type, 0), rvalue);
}
{
/* Hack alert: will cleanup later -- Dave */