fix warnings on Mac in tests
Fix these class of warnings:
- unused functions
- unused locals
- sign mismatch
- missing function prototypes
- missing newline at end of file
- 64 to 32 bit truncation
The changes prefer to link in dead code in the debug build
with 'if (false)' than to comment it out, but trivial cases
are commented out or sometimes deleted if it appears to be
a copy/paste error.
Review URL: https://codereview.appspot.com/6301045
git-svn-id: http://skia.googlecode.com/svn/trunk@4175 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 27a145e..690497a 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -80,7 +80,7 @@
}
}
-SkColorTable* init_ctable() {
+static SkColorTable* init_ctable() {
static const SkColor colors[] = {
SK_ColorBLACK, SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE
};
@@ -102,7 +102,7 @@
// Utility function to read the value of a given pixel in bm. All
// values converted to uint32_t for simplification of comparisons.
-uint32_t getPixel(int x, int y, const SkBitmap& bm) {
+static uint32_t getPixel(int x, int y, const SkBitmap& bm) {
uint32_t val = 0;
uint16_t val16;
uint8_t val8, shift;
@@ -137,7 +137,7 @@
// Utility function to set value of any pixel in bm.
// bm.getConfig() specifies what format 'val' must be
// converted to, but at present uint32_t can handle all formats.
-void setPixel(int x, int y, uint32_t val, SkBitmap& bm) {
+static void setPixel(int x, int y, uint32_t val, SkBitmap& bm) {
uint16_t val16;
uint8_t val8, shift;
SkAutoLockPixels lock(bm);
@@ -174,7 +174,7 @@
// Utility to return string containing name of each format, to
// simplify diagnostic output.
-const char* getSkConfigName(const SkBitmap& bm) {
+static const char* getSkConfigName(const SkBitmap& bm) {
switch (bm.getConfig()) {
case SkBitmap::kNo_Config: return "SkBitmap::kNo_Config";
case SkBitmap::kA1_Config: return "SkBitmap::kA1_Config";
@@ -211,7 +211,7 @@
// A function to verify that two bitmaps contain the same pixel values
// at all coordinates indicated by coords. Simplifies verification of
// copied bitmaps.
-void reportCopyVerification(const SkBitmap& bm1, const SkBitmap& bm2,
+static void reportCopyVerification(const SkBitmap& bm1, const SkBitmap& bm2,
Coordinates& coords,
const char* msg,
skiatest::Reporter* reporter){
@@ -232,7 +232,7 @@
}
// Writes unique pixel values at locations specified by coords.
-void writeCoordPixels(SkBitmap& bm, const Coordinates& coords) {
+static void writeCoordPixels(SkBitmap& bm, const Coordinates& coords) {
for (int i = 0; i < coords.length; ++i)
setPixel(coords[i]->fX, coords[i]->fY, i, bm);
}