* Python: fix default bool value.
* Small style tweak.
getter = "bool(" + getter + ")";
}
code += Indent + Indent + Indent + "return " + getter + "\n";
- auto defaultValue = (is_bool ? "False" : field.value.constant);
- code += Indent + Indent + "return " + defaultValue + "\n\n";
+ std::string default_value;
+ if (is_bool) {
+ default_value = field.value.constant == "0" ? "False" : "True";
+ } else {
+ default_value = field.value.constant;
+ }
+ code += Indent + Indent + "return " + default_value + "\n\n";
}
// Get a struct by initializing an existing struct.