From 61c9b835d13e1d4225f3a04f045658f62c702294 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Mon, 24 Mar 2014 15:52:33 +0000 Subject: [PATCH] Manual memset to work around bogus compiler warning bug. BUG=skia:2215 R=bsalomon@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/210013003 git-svn-id: http://skia.googlecode.com/svn/trunk@13908 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/WritePixelsTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp index 7adcf02..fc0fe37 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -329,7 +329,10 @@ static SkBaseDevice* createDevice(const CanvasConfig& c, GrContext* grCtx) { // if rowBytes isn't tight then set the padding to a known value if (rowBytes) { SkAutoLockPixels alp(bmp); - memset(bmp.getPixels(), DEV_PAD, bmp.getSafeSize()); + // We'd just use memset here but GCC 4.8.1 throws up a bogus warning when we do. + for (size_t i = 0; i < bmp.getSafeSize(); i++) { + ((uint8_t*)bmp.getPixels())[i] = DEV_PAD; + } } return new SkBitmapDevice(bmp); } -- 2.7.4