Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
a7eeee1e
Commit
a7eeee1e
authored
Oct 11, 2009
by
Alexander Wiebel
Browse files
[STYLE] fixed spacing in WValue.hpp and excluded operator definitions from checking of spaces
parent
b753cf6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
src/math/WValue.hpp
src/math/WValue.hpp
+10
-12
tools/brainlint.py
tools/brainlint.py
+1
-1
No files found.
src/math/WValue.hpp
View file @
a7eeee1e
...
...
@@ -33,7 +33,6 @@
namespace
wmath
{
/**
* Base class for all higher level values like tensors, vectors, matrices and so on.
*/
...
...
@@ -115,8 +114,8 @@ public:
*/
WValue
&
operator
+=
(
const
WValue
&
rhs
)
{
assert
(
m_components
.
size
()
==
rhs
.
m_components
.
size
());
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
assert
(
m_components
.
size
()
==
rhs
.
m_components
.
size
()
);
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
m_components
[
i
]
+=
rhs
.
m_components
[
i
];
return
*
this
;
}
...
...
@@ -126,8 +125,8 @@ public:
*/
WValue
&
operator
-=
(
const
WValue
&
rhs
)
{
assert
(
m_components
.
size
()
==
rhs
.
m_components
.
size
());
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
assert
(
m_components
.
size
()
==
rhs
.
m_components
.
size
()
);
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
m_components
[
i
]
-=
rhs
.
m_components
[
i
];
return
*
this
;
}
...
...
@@ -137,7 +136,7 @@ public:
*/
WValue
&
operator
*=
(
double
rhs
)
{
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
m_components
[
i
]
*=
rhs
;
return
*
this
;
}
...
...
@@ -148,8 +147,8 @@ public:
*/
WValue
&
operator
*=
(
const
WValue
&
rhs
)
{
assert
(
m_components
.
size
()
==
rhs
.
m_components
.
size
());
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
assert
(
m_components
.
size
()
==
rhs
.
m_components
.
size
()
);
for
(
unsigned
int
i
=
0
;
i
<
m_components
.
size
();
++
i
)
m_components
[
i
]
*=
rhs
.
m_components
[
i
];
return
*
this
;
}
...
...
@@ -159,7 +158,7 @@ public:
*/
const
WValue
operator
+
(
const
WValue
&
summand2
)
const
{
assert
(
m_components
.
size
()
==
summand2
.
m_components
.
size
());
assert
(
m_components
.
size
()
==
summand2
.
m_components
.
size
()
);
WValue
result
(
*
this
);
result
+=
summand2
;
return
result
;
...
...
@@ -170,7 +169,7 @@ public:
*/
const
WValue
operator
-
(
const
WValue
&
subtrahend
)
const
{
assert
(
m_components
.
size
()
==
subtrahend
.
m_components
.
size
());
assert
(
m_components
.
size
()
==
subtrahend
.
m_components
.
size
()
);
WValue
result
(
*
this
);
result
-=
subtrahend
;
return
result
;
...
...
@@ -181,7 +180,7 @@ public:
*/
const
WValue
operator
*
(
const
WValue
&
factor2
)
const
{
assert
(
m_components
.
size
()
==
factor2
.
m_components
.
size
());
assert
(
m_components
.
size
()
==
factor2
.
m_components
.
size
()
);
WValue
result
(
*
this
);
result
*=
factor2
;
return
result
;
...
...
@@ -278,6 +277,5 @@ template< typename T > const WValue< T > operator*( double lhs, const WValue< T
result
*=
lhs
;
return
result
;
}
}
// End of namepsace
#endif // WVALUE_H
tools/brainlint.py
View file @
a7eeee1e
...
...
@@ -1629,7 +1629,7 @@ def CheckSpacing(filename, clean_lines, linenum, error):
line
=
clean_lines
.
elided
[
linenum
]
# get rid of comments and strings
# Don't try to do spacing checks for operator methods
line
=
re
.
sub
(
r
'operator(==|!=|<|<<|<=|>=|>>|>)\('
,
'operator\('
,
line
)
line
=
re
.
sub
(
r
'operator(==|!=|
\+=|\-=|
<|<<|<=|>=|>>|>)\('
,
'operator\('
,
line
)
# We allow no-spaces around = within an if: "if ( (a=Foo()) == 0 )".
# Otherwise not. Note we only check for non-spaces on *both* sides;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment