Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: include/private/SkTArray.h

Issue 1902423007: Fix indentation and casts in SkTArray. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkTArray.h
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h
index 8d8f6598db96862df6f7cceb71e83f360e1f35cb..55d4f86aaabf63d9baf9f8a6a9d610175b6a23b8 100644
--- a/include/private/SkTArray.h
+++ b/include/private/SkTArray.h
@@ -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);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698