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/ImageInfo_bytesPerPixel.cpp b/docs/examples/ImageInfo_bytesPerPixel.cpp
index 29f2046..b15034f 100644
--- a/docs/examples/ImageInfo_bytesPerPixel.cpp
+++ b/docs/examples/ImageInfo_bytesPerPixel.cpp
@@ -15,7 +15,7 @@
} ) {
SkImageInfo info = SkImageInfo::Make(1, 1, colorType, kOpaque_SkAlphaType);
SkDebugf("color: k" "%s" "_SkColorType" "%*s" "bytesPerPixel: %d\n",
- colors[colorType], 13 - strlen(colors[colorType]), " ",
+ colors[colorType], (int)(13 - strlen(colors[colorType])), " ",
info.bytesPerPixel());
}
}