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

Add missing braces for clarity and clang (trivial) #3251

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

softins
Copy link
Member

@softins softins commented Mar 27, 2024

Short description of changes

This is a trivial change to add a pair of braces to CServerSettings::ReadSettingsFromXML() in settings.cpp, without changing the behaviour of the code.

CHANGELOG: SKIP

Context: Fixes an issue?

Previously, due to the separation of else and if by comments, make clang_format was always getting confused and messing with the indentation.

Does this change need documentation? What needs to be documented and how?

No

Status of this Pull Request

Ready to merge

What is missing until this pull request can be merged?

Review by eye and approval.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@softins softins requested review from pljones and ann0see March 27, 2024 17:55
Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

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

I'm not a fan of omitting { so that's good.

@softins softins added this to the Release 3.11.0 milestone Mar 28, 2024
@@ -901,6 +902,7 @@ void CServerSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the else block at line 895 be enclosed in braces, too, for the sake of consistency?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wouldn't have thought so. We only need to solve the clang confusion due to the comments being between the else on 877 and the if belonging to it on 885.

@pljones pljones added the refactoring Non-behavioural changes, Code cleanup label Mar 28, 2024
@softins softins merged commit 85d1f2d into jamulussoftware:main Mar 28, 2024
11 checks passed
@softins softins deleted the missing-braces branch March 28, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Non-behavioural changes, Code cleanup
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants