-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: unsingletonize Resources/Resources2 #5460
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,10 +2,15 @@ | |||||||||||||
|
||||||||||||||
#include "debug/AssertInGuiThread.hpp" | ||||||||||||||
|
||||||||||||||
namespace chatterino { | ||||||||||||||
namespace { | ||||||||||||||
static Resources2 *resources = nullptr; | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
using namespace chatterino; | ||||||||||||||
|
||||||||||||||
static Resources2 *resources = nullptr; | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: invalid case style for global variable 'resources' [readability-identifier-naming]
Suggested change
src/singletons/Resources.cpp:16: - assert(resources);
+ assert(RESOURCES); src/singletons/Resources.cpp:18: - return *resources;
+ return *RESOURCES; src/singletons/Resources.cpp:25: - resources = new Resources2;
+ RESOURCES = new Resources2; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'resources' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables] static Resources2 *resources = nullptr;
^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'resources' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables] static Resources2 *resources = nullptr;
^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 'resources' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: invalid case style for global variable 'resources' [readability-identifier-naming]
Suggested change
src/singletons/Resources.cpp:16: - assert(resources);
+ assert(RESOURCES); src/singletons/Resources.cpp:18: - return *resources;
+ return *RESOURCES; src/singletons/Resources.cpp:25: - resources = new Resources2;
+ RESOURCES = new Resources2; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'resources' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables] static Resources2 *resources = nullptr;
^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'resources' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables] static Resources2 *resources = nullptr;
^ |
||||||||||||||
|
||||||||||||||
} // namespace | ||||||||||||||
|
||||||||||||||
namespace chatterino { | ||||||||||||||
|
||||||||||||||
Resources2 &getResources() | ||||||||||||||
{ | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'resources' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]