Loading...
libkern/c++/OSDictionary.cpp xnu-1504.3.12 xnu-1228
--- xnu/xnu-1504.3.12/libkern/c++/OSDictionary.cpp
+++ xnu/xnu-1228/libkern/c++/OSDictionary.cpp
@@ -87,7 +87,7 @@
                                    unsigned int theCount,
                                    unsigned int theCapacity)
 {
-    unsigned int newCapacity = theCount;
+    unsigned int capacity = theCount;
 
     if (!objects || !keys)
         return false;
@@ -96,10 +96,10 @@
         if (theCount > theCapacity)
             return false;
         
-        newCapacity = theCapacity;
-    }
-
-    if (!initWithCapacity(newCapacity))
+        capacity = theCapacity;
+    }
+
+    if (!initWithCapacity(capacity))
         return false;
 
     for (unsigned int i = 0; i < theCount; i++) {
@@ -117,7 +117,7 @@
                                    unsigned int theCount,
                                    unsigned int theCapacity)
 {
-    unsigned int newCapacity = theCount;
+    unsigned int capacity = theCount;
 
     if (!objects || !keys)
         return false;
@@ -126,10 +126,10 @@
         if (theCount > theCapacity)
             return false;
 
-        newCapacity = theCapacity;
-    }
-
-    if (!initWithCapacity(newCapacity))
+        capacity = theCapacity;
+    }
+
+    if (!initWithCapacity(capacity))
         return false;
 
     for (unsigned int i = 0; i < theCount; i++) {
@@ -153,21 +153,21 @@
 bool OSDictionary::initWithDictionary(const OSDictionary *dict,
                                       unsigned int theCapacity)
 {
-    unsigned int newCapacity;
+    unsigned int capacity;
 
     if ( !dict )
         return false;
 
-    newCapacity = dict->count;
+    capacity = dict->count;
 
     if ( theCapacity ) {
         if ( dict->count > theCapacity )
             return false;
         
-        newCapacity = theCapacity;
-    }
-
-    if (!initWithCapacity(newCapacity))
+        capacity = theCapacity;
+    }
+
+    if (!initWithCapacity(capacity))
         return false;
 
     count = dict->count;
@@ -371,7 +371,7 @@
     if ( !OSDynamicCast(OSDictionary, srcDict) )
         return false;
 
-    iter = OSCollectionIterator::withCollection(const_cast<OSDictionary *>(srcDict));
+    iter = OSCollectionIterator::withCollection((OSDictionary *)srcDict);
     if ( !iter )
         return false;
 
@@ -397,7 +397,7 @@
     // if the key exists, remove the object
     for (unsigned int i = 0; i < count; i++)
         if (aKey == dictionary[i].key)
-            return (const_cast<OSObject *> ((const OSObject *)dictionary[i].value));
+            return (OSObject *) dictionary[i].value;
 
     return 0;
 }