Skip to content

Commit a8dbcbf

Browse files
committed
Code style reformatting using clang-format
1 parent 81b8cfa commit a8dbcbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1971
-1186
lines changed

.clang-format

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# inherit Mozilla style
2+
BasedOnStyle: Mozilla
3+
4+
# set a column limit, but don't be super strict about it
5+
ColumnLimit: 80
6+
PenaltyExcessCharacter: 100
7+
8+
# set indent widths
9+
IndentWidth: 4
10+
ConstructorInitializerIndentWidth: 4
11+
ContinuationIndentWidth: 4
12+
AccessModifierOffset: -4
13+
14+
# don't squeeze short functions into one line
15+
AllowShortFunctionsOnASingleLine: false
16+
17+
# try to keep return type on the same line
18+
AlwaysBreakAfterDefinitionReturnType: None
19+
AlwaysBreakAfterReturnType: None
20+
21+
# use C++11 list style
22+
Cpp11BracedListStyle: true
23+
24+
# don't try to squeeze parameters to the right if they don't fit in one line
25+
AlignAfterOpenBracket: DontAlign

ati3dcif/CifError.cpp

+23-16
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,36 @@
33

44
namespace cif {
55

6-
CifError::CifError(const char* message, C3D_EC errorCode) :
7-
std::runtime_error(message),
8-
m_errorCode(errorCode)
9-
{ }
6+
CifError::CifError(const char* message, C3D_EC errorCode)
7+
: std::runtime_error(message)
8+
, m_errorCode(errorCode)
9+
{
10+
}
1011

11-
CifError::CifError(const std::string& message, C3D_EC errorCode) :
12-
CifError(message.c_str(), errorCode)
13-
{ }
12+
CifError::CifError(const std::string& message, C3D_EC errorCode)
13+
: CifError(message.c_str(), errorCode)
14+
{
15+
}
1416

15-
CifError::CifError(const char* message) :
16-
CifError(message, C3D_EC_GENFAIL)
17-
{ }
17+
CifError::CifError(const char* message)
18+
: CifError(message, C3D_EC_GENFAIL)
19+
{
20+
}
1821

19-
CifError::CifError(const std::string& message) :
20-
CifError(message.c_str(), C3D_EC_GENFAIL)
21-
{ }
22+
CifError::CifError(const std::string& message)
23+
: CifError(message.c_str(), C3D_EC_GENFAIL)
24+
{
25+
}
2226

23-
C3D_EC CifError::getErrorCode() const {
27+
C3D_EC
28+
CifError::getErrorCode() const
29+
{
2430
return m_errorCode;
2531
}
2632

27-
const char* CifError::getErrorName() const {
33+
const char* CifError::getErrorName() const
34+
{
2835
return C3D_EC_NAMES[m_errorCode];
2936
}
3037

31-
}
38+
} // namespace cif

ati3dcif/CifError.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
namespace cif {
99

10-
class CifError : public std::runtime_error {
10+
class CifError : public std::runtime_error
11+
{
1112
public:
1213
CifError(const char* message, C3D_EC errorCode);
1314
CifError(const std::string& message, C3D_EC errorCode);
@@ -20,4 +21,4 @@ class CifError : public std::runtime_error {
2021
C3D_EC m_errorCode;
2122
};
2223

23-
}
24+
} // namespace cif

0 commit comments

Comments
 (0)