simobject, dictionary, stringtable, and taml clarificationsand cleanups

This commit is contained in:
Azaezel 2018-03-13 17:30:33 -05:00
parent 9dd9d2f9b7
commit f36826605f
4 changed files with 20 additions and 20 deletions

View file

@ -245,17 +245,17 @@ void SimFieldDictionary::writeFields(SimObject *obj, Stream &stream, U32 tabStop
const AbstractClassRep::FieldList &list = obj->getFieldList(); const AbstractClassRep::FieldList &list = obj->getFieldList();
Vector<Entry *> flist(__FILE__, __LINE__); Vector<Entry *> flist(__FILE__, __LINE__);
for (U32 i = 0; i < HashTableSize; i++) for (U32 curEntry = 0; curEntry < HashTableSize; curEntry++)
{ {
for (Entry *walk = mHashTable[i]; walk; walk = walk->next) for (Entry *walk = mHashTable[curEntry]; walk; walk = walk->next)
{ {
// make sure we haven't written this out yet: // make sure we haven't written this out yet:
U32 i; U32 curField;
for (i = 0; i < list.size(); i++) for (curField = 0; curField < list.size(); curField++)
if (list[i].pFieldname == walk->slotName) if (list[curField].pFieldname == walk->slotName)
break; break;
if (i != list.size()) if (curField != list.size())
continue; continue;
@ -293,17 +293,17 @@ void SimFieldDictionary::printFields(SimObject *obj)
char expandedBuffer[4096]; char expandedBuffer[4096];
Vector<Entry *> flist(__FILE__, __LINE__); Vector<Entry *> flist(__FILE__, __LINE__);
for (U32 i = 0; i < HashTableSize; i++) for (U32 curEntry = 0; curEntry < HashTableSize; curEntry++)
{ {
for (Entry *walk = mHashTable[i]; walk; walk = walk->next) for (Entry *walk = mHashTable[curEntry]; walk; walk = walk->next)
{ {
// make sure we haven't written this out yet: // make sure we haven't written this out yet:
U32 i; U32 curField;
for (i = 0; i < list.size(); i++) for (curField = 0; curField < list.size(); curField++)
if (list[i].pFieldname == walk->slotName) if (list[curField].pFieldname == walk->slotName)
break; break;
if (i != list.size()) if (curField != list.size())
continue; continue;
flist.push_back(walk); flist.push_back(walk);

View file

@ -529,17 +529,17 @@ void SimObject::onTamlCustomRead(TamlCustomNodes const& customNodes)
for (TamlCustomFieldVector::const_iterator fieldItr = fields.begin(); fieldItr != fields.end(); ++fieldItr) for (TamlCustomFieldVector::const_iterator fieldItr = fields.begin(); fieldItr != fields.end(); ++fieldItr)
{ {
// Fetch field. // Fetch field.
const TamlCustomField* pField = *fieldItr; const TamlCustomField* cField = *fieldItr;
// Fetch field name. // Fetch field name.
StringTableEntry fieldName = pField->getFieldName(); StringTableEntry fieldName = cField->getFieldName();
const AbstractClassRep::Field* field = findField(fieldName); const AbstractClassRep::Field* field = findField(fieldName);
// Check common fields. // Check common fields.
if (field) if (field)
{ {
setDataField(fieldName, buf, pField->getFieldValue()); setDataField(fieldName, buf, cField->getFieldValue());
} }
else else
{ {

View file

@ -232,7 +232,7 @@ void _StringTable::resize(const U32 _newSize)
walk = head; walk = head;
while(walk) { while(walk) {
U32 key; U32 key;
Node *temp = walk; temp = walk;
walk = walk->next; walk = walk->next;
key = hashString(temp->val); key = hashString(temp->val);

View file

@ -1241,8 +1241,8 @@ ImplementEnumType(_TamlFormatMode,
// ************************************************************* // *************************************************************
// Generate the engine type elements. // Generate the engine type elements.
TiXmlComment* pComment = new TiXmlComment("Type Elements"); TiXmlComment* tComment = new TiXmlComment("Type Elements");
pSchemaElement->LinkEndChild(pComment); pSchemaElement->LinkEndChild(tComment);
for (AbstractClassRep* pType = pRootType; pType != NULL; pType = pType->getNextClass()) for (AbstractClassRep* pType = pRootType; pType != NULL; pType = pType->getNextClass())
{ {
// Add type. // Add type.
@ -1260,8 +1260,8 @@ ImplementEnumType(_TamlFormatMode,
{ {
// Add complex type comment. // Add complex type comment.
dSprintf(buffer, sizeof(buffer), " %s Type ", pType->getClassName()); dSprintf(buffer, sizeof(buffer), " %s Type ", pType->getClassName());
TiXmlComment* pComment = new TiXmlComment(buffer); TiXmlComment* ctComment = new TiXmlComment(buffer);
pSchemaElement->LinkEndChild(pComment); pSchemaElement->LinkEndChild(ctComment);
// Add complex type. // Add complex type.
TiXmlElement* pComplexTypeElement = new TiXmlElement("xs:complexType"); TiXmlElement* pComplexTypeElement = new TiXmlElement("xs:complexType");