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

Unified Diff: samplecode/SampleApp.cpp

Issue 1516833003: Switch SkAutoMalloc to SkAutoTMalloc to avoid cast (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Go back to patch set 3 Created 5 years 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 | « include/private/SkTemplates.h ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index c71fda5f9d991a578fcda314dacade1066635861..f9865dcfc0afb23fef3d8c3be27d046c3ffd6e3f 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -27,6 +27,7 @@
#include "SkPictureRecorder.h"
#include "SkStream.h"
#include "SkSurface.h"
+#include "SkTemplates.h"
#include "SkTSort.h"
#include "SkTime.h"
#include "SkTypeface.h"
@@ -792,8 +793,8 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
SkFILEStream stream(FLAGS_sequence[0]);
if (stream.isValid()) {
size_t len = stream.getLength();
- SkAutoMalloc storage(len + 1);
- char* buffer = (char*)storage.get();
+ SkAutoTMalloc<char> storage(len + 1);
+ char* buffer = storage.get();
stream.read(buffer, len);
buffer[len] = 0;
« no previous file with comments | « include/private/SkTemplates.h ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698