general: fix various compiler warnings and issues exposed thereby

This commit is contained in:
rdb
2018-05-30 11:09:35 +02:00
parent 3029780f88
commit 6b726fa697
92 changed files with 138 additions and 167 deletions
@@ -2636,8 +2636,6 @@ write_module_class(ostream &out, Object *obj) {
if (obj->_properties.size() > 0) {
// Write out the array of properties, telling Python which getter and
// setter to call when they are assigned or queried in Python code.
out << "static PyGetSetDef Dtool_Properties_" << ClassName << "[] = {\n";
Properties::const_iterator pit;
for (pit = obj->_properties.begin(); pit != obj->_properties.end(); ++pit) {
Property *property = (*pit);
@@ -2646,6 +2644,10 @@ write_module_class(ostream &out, Object *obj) {
continue;
}
if (num_getset == 0) {
out << "static PyGetSetDef Dtool_Properties_" << ClassName << "[] = {\n";
}
++num_getset;
string name1 = methodNameFromCppName(ielem.get_name(), "", false);
@@ -2679,8 +2681,10 @@ write_module_class(ostream &out, Object *obj) {
}*/
}
out << " {NULL},\n";
out << "};\n\n";
if (num_getset != 0) {
out << " {NULL},\n";
out << "};\n\n";
}
}
// These fields are inherited together. We should either write all of them
@@ -7077,9 +7081,8 @@ record_object(TypeIndex type_index) {
int num_elements = itype.number_of_elements();
for (int ei = 0; ei < num_elements; ei++) {
ElementIndex element_index = itype.get_element(ei);
const InterrogateElement &ielement = idb->get_element(element_index);
Property *property = record_property(itype, itype.get_element(ei));
Property *property = record_property(itype, element_index);
if (property != nullptr) {
object->_properties.push_back(property);
} else {