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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ void CServerSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
directoryType = bValue ? AT_DEFAULT : AT_CUSTOM;
}
else
{
//### TODO: END ###//

// if "directorytype" itself is set, use it (note "AT_NONE", "AT_DEFAULT" and "AT_CUSTOM" are min/max directory type here)
Expand All @@ -892,15 +893,19 @@ void CServerSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
}
//### TODO: END ###//

else if ( GetNumericIniSet ( IniXMLDocument,
"server",
"directorytype",
static_cast<int> ( AT_NONE ),
static_cast<int> ( AT_CUSTOM ),
iValue ) )
else
{
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.

directoryType = static_cast<EDirectoryType> ( iValue );
if ( GetNumericIniSet ( IniXMLDocument,
"server",
"directorytype",
static_cast<int> ( AT_NONE ),
static_cast<int> ( AT_CUSTOM ),
iValue ) )
{
directoryType = static_cast<EDirectoryType> ( iValue );
}
}
}

//### TODO: BEGIN ###//
// compatibility to old version < 3.9.0
Expand Down