Skip to content

Commit

Permalink
Sandbox: Use less generic name for [[nodiscard]] rationale
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Dec 22, 2023
1 parent 3a6b9f8 commit 58ddbb7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/util/sandbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,26 @@ 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;

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.
Expand Down

0 comments on commit 58ddbb7

Please sign in to comment.