compilerplugins/clang/casttovoid.cxx | 5 +++++ vcl/skia/osx/gdiimpl.cxx | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-)
New commits: commit 969990becc001d5fe5a34ff976cb022786c10c76 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Oct 9 16:36:11 2023 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Oct 9 22:33:02 2023 +0200 Avoid a false loplugin:casttovoid on macOS ...involving conditional preprocessed code at > vcl/skia/SkiaHelper.cxx:265:13: error: unnecessary cast to void [loplugin:casttovoid] > 265 | (void)blockDisable; > | ^~~~~~~~~~~~~~~~~~ > vcl/skia/SkiaHelper.cxx:286:22: note: first consumption is here [loplugin:casttovoid] > 286 | if (!blockDisable && !DefaultMTLDeviceIsSupported()) > | ^~~~~~~~~~~~ Change-Id: I222d72d240852be2d64fe08d345f00d137cd5a63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157707 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/casttovoid.cxx b/compilerplugins/clang/casttovoid.cxx index bddfcb4da503..c02cf6887365 100644 --- a/compilerplugins/clang/casttovoid.cxx +++ b/compilerplugins/clang/casttovoid.cxx @@ -425,6 +425,11 @@ private: } } } else { + if (auto const fun = dyn_cast_or_null<FunctionDecl>(i.first->getDeclContext())) { + if (containsPreprocessingConditionalInclusion(fun->getSourceRange())) { + continue; + } + } for (auto const j: i.second.castToVoid) { report( DiagnosticsEngine::Warning, "unnecessary cast to void", commit ba124320327beea8a4068ffa93a9050fa3dd5c38 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Oct 9 16:45:07 2023 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Oct 9 22:32:47 2023 +0200 loplugin:casttovoid Change-Id: Ifa6c18651b2e3faa4500f19217bf11dba10f02fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157709 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/vcl/skia/osx/gdiimpl.cxx b/vcl/skia/osx/gdiimpl.cxx index e64f84b111bc..752208c0bc41 100644 --- a/vcl/skia/osx/gdiimpl.cxx +++ b/vcl/skia/osx/gdiimpl.cxx @@ -37,9 +37,8 @@ using namespace SkiaHelper; -static void releaseInstalledPixels(void* pAddr, void* pContext) +static void releaseInstalledPixels(void* pAddr, void*) { - (void)pContext; if (pAddr) delete[] static_cast<sal_uInt8*>(pAddr); }