From 58ddbb73e38174b4b1ff5f1e57e1a52deb09ce7c Mon Sep 17 00:00:00 2001 From: fwcd Date: Fri, 22 Dec 2023 12:22:52 +0100 Subject: [PATCH] Sandbox: Use less generic name for [[nodiscard]] rationale --- src/util/sandbox.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/util/sandbox.h b/src/util/sandbox.h index 6321f99a917..4c262df2ac0 100644 --- a/src/util/sandbox.h +++ b/src/util/sandbox.h @@ -54,17 +54,17 @@ class Sandbox { } #if defined(__GNUC__) && __cplusplus < 201907L -#define RATIONALE +#define SECURITY_TOKEN_NODISCARD_RATIONALE #else -#define RATIONALE \ +#define SECURITY_TOKEN_NODISCARD_RATIONALE \ ("A new security token should be used, e.g. by assigning it to a " \ "variable, otherwise it will be invalidated immediately.") #endif - [[nodiscard RATIONALE]] static SecurityTokenPointer openSecurityToken( - mixxx::FileInfo* pFileInfo, bool create); - [[nodiscard RATIONALE]] static SecurityTokenPointer openSecurityTokenForDir( - const QDir& dir, bool create); + [[nodiscard SECURITY_TOKEN_NODISCARD_RATIONALE]] static SecurityTokenPointer + openSecurityToken(mixxx::FileInfo* pFileInfo, bool create); + [[nodiscard SECURITY_TOKEN_NODISCARD_RATIONALE]] static SecurityTokenPointer + openSecurityTokenForDir(const QDir& dir, bool create); private: Sandbox() = delete; @@ -72,7 +72,8 @@ class Sandbox { static ConfigKey keyForCanonicalPath(const QString& canonicalPath); // Must hold s_mutex to call this. - [[nodiscard RATIONALE]] static SecurityTokenPointer openTokenFromBookmark( + [[nodiscard SECURITY_TOKEN_NODISCARD_RATIONALE]] static SecurityTokenPointer + openTokenFromBookmark( const QString& canonicalPath, const QString& bookmarkBase64); // Creates a security token. s_mutex is not needed for this method.