Skip to content
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

Merged
merged 2 commits into from
Jun 16, 2024

Conversation

pajlada
Copy link
Member

@pajlada pajlada commented Jun 16, 2024

No description provided.

@pajlada
Copy link
Member Author

pajlada commented Jun 16, 2024

image

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

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]

Suggested change
static Resources2 *resources = nullptr;
Resources2 *resources = nullptr;


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The 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
static Resources2 *resources = nullptr;
static Resources2 *RESOURCES = nullptr;

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;


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
                   ^


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
                   ^

@pajlada pajlada enabled auto-merge (squash) June 16, 2024 12:47
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

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]

Suggested change
static Resources2 *resources = nullptr;
Resources2 *resources = nullptr;


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The 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
static Resources2 *resources = nullptr;
static Resources2 *RESOURCES = nullptr;

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;


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
                   ^


using namespace chatterino;

static Resources2 *resources = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
                   ^

@pajlada pajlada merged commit 85d6ff1 into master Jun 16, 2024
17 checks passed
@pajlada pajlada deleted the chore/unsingletonize-resources branch June 16, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant