Add format-specifier warnings to SkDebugf.
This CL fixes up many existing format-specifier violations in Skia.
Note that GCC has a warning for formatting nothing, so existing calls to
`SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
These were apparently meant to be used as a place to set a breakpoint.
Some of our clients also use SkDebug with bad format specifiers, so this
check is currently only enabled when SKIA_IMPLEMENTATION is true.
Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/docs/examples/Bitmap_shiftPerPixel.cpp b/docs/examples/Bitmap_shiftPerPixel.cpp
index 7232211..a011f7e 100644
--- a/docs/examples/Bitmap_shiftPerPixel.cpp
+++ b/docs/examples/Bitmap_shiftPerPixel.cpp
@@ -17,7 +17,7 @@
} ) {
bitmap.setInfo(info.makeColorType(colorType));
SkDebugf("color: k" "%s" "_SkColorType" "%*s" "shiftPerPixel: %d\n",
- colors[colorType], 14 - strlen(colors[colorType]), " ",
+ colors[colorType], (int)(14 - strlen(colors[colorType])), " ",
bitmap.shiftPerPixel());
}
}