mirror of
https://github.com/panda3d/panda3d.git
synced 2026-05-02 04:30:03 -05:00
general: fix various compiler warnings and issues exposed thereby
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user