From 103741882a7a49deac1f78a68a4c561d30cc52dc Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 30 Jul 2019 21:10:08 +0200 Subject: [PATCH] PVS V542: operator precedence issue accross macro expansion In CodyCam, we attempt to cast the result of this macro to const char*. However, the ternary operator has lower priority than the cast so it doesn't work as expected. Add some protective parentheses here. Change-Id: I5e9875187cec67b9534b1bbe58d82217c6cd5524 Reviewed-on: https://review.haiku-os.org/c/1667 Reviewed-by: waddlesplash --- headers/os/locale/Catalog.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/os/locale/Catalog.h b/headers/os/locale/Catalog.h index 910d05aeef..76723936a4 100644 --- a/headers/os/locale/Catalog.h +++ b/headers/os/locale/Catalog.h @@ -119,10 +119,10 @@ private: #undef B_TRANSLATE_SYSTEM_NAME #define B_TRANSLATE_SYSTEM_NAME(string) \ - BLocaleRoster::Default()->IsFilesystemTranslationPreferred() \ + (BLocaleRoster::Default()->IsFilesystemTranslationPreferred() \ ? BLocaleRoster::Default()->GetCatalog()->GetString((string), \ B_TRANSLATION_SYSTEM_NAME_CONTEXT) \ - : (string) + : (string)) // Translation markers which can be used to mark static strings/IDs which // are used as key for translation requests (at other places in the code).