Fix indentation and casts in SkTArray.
authorbungeman <bungeman@google.com>
Thu, 21 Apr 2016 17:52:03 +0000 (10:52 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 21 Apr 2016 17:52:03 +0000 (10:52 -0700)
Review URL: https://codereview.chromium.org/1902423007

include/private/SkTArray.h

index 8d8f659..55d4f86 100644 (file)
@@ -194,11 +194,11 @@ public:
      */
     T* push_back_n(int n) {
         SkASSERT(n >= 0);
-        char* newTs = static_cast<char*>(this->push_back_raw(n));
+        void* newTs = this->push_back_raw(n);
         for (int i = 0; i < n; ++i) {
-          new (newTs + i * sizeof(T)) T;
+            new (static_cast<char*>(newTs) + i * sizeof(T)) T;
         }
-        return reinterpret_cast<T*>(newTs);
+        return static_cast<T*>(newTs);
     }
 
     /**
@@ -207,11 +207,11 @@ public:
      */
     T* push_back_n(int n, const T& t) {
         SkASSERT(n >= 0);
-        char* newTs = static_cast<char*>(this->push_back_raw(n));
+        void* newTs = this->push_back_raw(n);
         for (int i = 0; i < n; ++i) {
-          new (newTs + i * sizeof(T)) T(t);
+            new (static_cast<char*>(newTs) + i * sizeof(T)) T(t);
         }
-        return reinterpret_cast<T*>(newTs);
+        return static_cast<T*>(newTs);
     }
 
     /**