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/Pixmap_shiftPerPixel.cpp b/docs/examples/Pixmap_shiftPerPixel.cpp
index cd48ad9..f169df5 100644
--- a/docs/examples/Pixmap_shiftPerPixel.cpp
+++ b/docs/examples/Pixmap_shiftPerPixel.cpp
@@ -29,7 +29,7 @@
kGray_8_SkColorType, kRGBA_F16_SkColorType } ) {
SkPixmap pixmap(info.makeColorType(colorType), nullptr, 4);
SkDebugf("color: k" "%s" "_SkColorType" "%*s" "bytesPerPixel: %d shiftPerPixel: %d\n",
- color_type(colorType), 10 - strlen(color_type(colorType)), " ",
+ color_type(colorType), (int)(10 - strlen(color_type(colorType))), " ",
pixmap.info().bytesPerPixel(), pixmap.shiftPerPixel());
}
}