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
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 @@
// 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);
}