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

-Wextra-semi #4699

Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ StatementMacros:
- itkTemplateFloatingToIntegerMacro
- itkPadStruct
- itkLegacyMacro
- IPLSetMacroDeclaration
- IPLGetMacroDeclaration
TabWidth: 2
UseTab: Never
...
22 changes: 8 additions & 14 deletions Modules/IO/IPL/include/itkIPLFileNameList.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,15 @@ class IPLFileSortInfo

virtual ~IPLFileSortInfo();

IPLSetMacroDeclaration(ImageFileName, std::string);
IPLGetMacroDeclaration(ImageFileName, std::string);
IPLSetMacroDeclaration(SliceLocation, float);
IPLGetMacroDeclaration(SliceLocation, float);
IPLSetMacroDeclaration(SliceOffset, int);
IPLGetMacroDeclaration(SliceOffset, int);
IPLSetMacroDeclaration(EchoNumber, int);
IPLGetMacroDeclaration(EchoNumber, int);
IPLSetMacroDeclaration(ImageNumber, int);
IPLGetMacroDeclaration(ImageNumber, int);
IPLSetMacroDeclaration(Data, void *);
IPLGetMacroDeclaration(Data, const void *);
IPLSetMacroDeclaration(ImageFileName, std::string)
IPLGetMacroDeclaration(ImageFileName, std::string) IPLSetMacroDeclaration(SliceLocation, float)
IPLGetMacroDeclaration(SliceLocation, float) IPLSetMacroDeclaration(SliceOffset, int)
IPLGetMacroDeclaration(SliceOffset, int) IPLSetMacroDeclaration(EchoNumber, int)
IPLGetMacroDeclaration(EchoNumber, int) IPLSetMacroDeclaration(ImageNumber, int)
IPLGetMacroDeclaration(ImageNumber, int) IPLSetMacroDeclaration(Data, void *)
IPLGetMacroDeclaration(Data, const void *)

private:
std::string m_ImageFileName{};
private : std::string m_ImageFileName{};
Comment on lines +96 to +104
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting wrong here too. Hopefully running clang-format will fix it, since you added these macros to StatementMacros.

Copy link
Member

Choose a reason for hiding this comment

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

I would really prefer to NOT remove the semi-colons. It makes clang-formatting very challenging and tedious. Additionally, many modern IDE's complain about the lack of ; at the end of what is interpreted as a statement.

I would prefer that the macros are always terminated by a statement, or a NOOP statement as is proposed in #4706

Copy link
Contributor

Choose a reason for hiding this comment

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

It makes clang-formatting very challenging and tedious.

How so? Are you perhaps not aware of clang-format's statementmacros setting?

Additionally, many modern IDE's complain about the lack of ; at the end of what is interpreted as a statement.

I've never seen that, could you give an example?

float m_SliceLocation{};
int m_SliceOffset{};
int m_EchoNumber{};
Expand Down