Skip to content

chore: unsingletonize Resources/Resources2 - #5460

Merged
pajlada merged 2 commits into
masterfrom
chore/unsingletonize-resources
Jun 16, 2024
Merged

pajlada merged 2 commits into
masterfrom
chore/unsingletonize-resources

Conversation

@pajlada

@pajlada pajlada commented Jun 16, 2024

Copy link
Copy Markdown
Member

No description provided.

@pajlada

pajlada commented Jun 16, 2024

Copy link
Copy Markdown
Member Author

image

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@pajlada
pajlada deleted the chore/unsingletonize-resources branch June 16, 2024 13:17
babicekmarek pushed a commit to babicekmarek/streamally-chatterino that referenced this pull request Sep 14, 2026
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