diff options
author | John Stiles <johnstiles@google.com> | 2021-06-24 18:05:10 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2021-06-25 11:05:59 +0000 |
commit | e58831cd9578805634b986b434a20757277b3a36 (patch) | |
tree | c667982cc4c74753b4419fbd71ce019d3d974bba /src/core/SkSharedMutex.cpp | |
parent | 3a35f0b263cbdad011ffff6e5032f5996e946239 (diff) | |
download | skia-e58831cd9578805634b986b434a20757277b3a36.tar.gz |
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>
Diffstat (limited to 'src/core/SkSharedMutex.cpp')
-rw-r--r-- | src/core/SkSharedMutex.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/SkSharedMutex.cpp b/src/core/SkSharedMutex.cpp index 5d34e42d9b..6ae129a6be 100644 --- a/src/core/SkSharedMutex.cpp +++ b/src/core/SkSharedMutex.cpp @@ -10,6 +10,8 @@ #include "include/core/SkTypes.h" #include "include/private/SkSemaphore.h" +#include <cinttypes> + #if !defined(__has_feature) #define __has_feature(x) 0 #endif @@ -132,10 +134,10 @@ SkAutoMutexExclusive l(fMu); SkASSERTF(!fCurrentShared->find(threadID), - "Thread %lx already has an shared lock\n", threadID); + "Thread %" PRIx64 " already has an shared lock\n", threadID); if (!fWaitingExclusive->tryAdd(threadID)) { - SkDEBUGFAILF("Thread %lx already has an exclusive lock\n", threadID); + SkDEBUGFAILF("Thread %" PRIx64 " already has an exclusive lock\n", threadID); } currentSharedCount = fCurrentShared->count(); @@ -162,7 +164,7 @@ SkAutoMutexExclusive l(fMu); SkASSERT(0 == fCurrentShared->count()); if (!fWaitingExclusive->tryRemove(threadID)) { - SkDEBUGFAILF("Thread %lx did not have the lock held.\n", threadID); + SkDEBUGFAILF("Thread %" PRIx64 " did not have the lock held.\n", threadID); } exclusiveWaitingCount = fWaitingExclusive->count(); sharedWaitingCount = fWaitingShared->count(); @@ -196,11 +198,11 @@ exclusiveWaitingCount = fWaitingExclusive->count(); if (exclusiveWaitingCount > 0) { if (!fWaitingShared->tryAdd(threadID)) { - SkDEBUGFAILF("Thread %lx was already waiting!\n", threadID); + SkDEBUGFAILF("Thread %" PRIx64 " was already waiting!\n", threadID); } } else { if (!fCurrentShared->tryAdd(threadID)) { - SkDEBUGFAILF("Thread %lx already holds a shared lock!\n", threadID); + SkDEBUGFAILF("Thread %" PRIx64 " already holds a shared lock!\n", threadID); } } sharedQueueSelect = fSharedQueueSelect; @@ -222,7 +224,7 @@ { SkAutoMutexExclusive l(fMu); if (!fCurrentShared->tryRemove(threadID)) { - SkDEBUGFAILF("Thread %lx does not hold a shared lock.\n", threadID); + SkDEBUGFAILF("Thread %" PRIx64 " does not hold a shared lock.\n", threadID); } currentSharedCount = fCurrentShared->count(); waitingExclusiveCount = fWaitingExclusive->count(); |