浏览代码

simobject, dictionary, stringtable, and taml clarificationsand cleanups

Azaezel 7 年之前
父节点
当前提交
f36826605f

+ 12 - 12
Engine/source/console/simFieldDictionary.cpp

@@ -245,17 +245,17 @@ void SimFieldDictionary::writeFields(SimObject *obj, Stream &stream, U32 tabStop
    const AbstractClassRep::FieldList &list = obj->getFieldList();
    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:
-         U32 i;
-         for (i = 0; i < list.size(); i++)
-            if (list[i].pFieldname == walk->slotName)
+         U32 curField;
+         for (curField = 0; curField < list.size(); curField++)
+            if (list[curField].pFieldname == walk->slotName)
                break;
 
-         if (i != list.size())
+         if (curField != list.size())
             continue;
 
 
@@ -293,17 +293,17 @@ void SimFieldDictionary::printFields(SimObject *obj)
    char expandedBuffer[4096];
    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:
-         U32 i;
-         for (i = 0; i < list.size(); i++)
-            if (list[i].pFieldname == walk->slotName)
+         U32 curField;
+         for (curField = 0; curField < list.size(); curField++)
+            if (list[curField].pFieldname == walk->slotName)
                break;
 
-         if (i != list.size())
+         if (curField != list.size())
             continue;
 
          flist.push_back(walk);

+ 3 - 3
Engine/source/console/simObject.cpp

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

+ 1 - 1
Engine/source/core/stringTable.cpp

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

+ 4 - 4
Engine/source/persistence/taml/taml.cpp

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