Skip to content

Commit

Permalink
Adjust style to match our conventions (#181)
Browse files Browse the repository at this point in the history
Use {} on separate lines around if statements.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters authored Dec 2, 2020
1 parent 454e906 commit e5f264b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 14 deletions.
3 changes: 1 addition & 2 deletions include/ignition/math/Color.hh
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ namespace ignition
{
_in >> _pt.a;
}
else
if (!_in.fail())
else if (!_in.fail())
{
_pt.a = 1.0;
}
Expand Down
8 changes: 5 additions & 3 deletions include/ignition/math/Matrix3.hh
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,11 @@ namespace ignition
>> d[6] >> d[7] >> d[8];

if (!_in.fail())
_m.Set(d[0], d[1], d[2],
d[3], d[4], d[5],
d[6], d[7], d[8]);
{
_m.Set(d[0], d[1], d[2],
d[3], d[4], d[5],
d[6], d[7], d[8]);
}
return _in;
}

Expand Down
10 changes: 6 additions & 4 deletions include/ignition/math/Matrix4.hh
Original file line number Diff line number Diff line change
Expand Up @@ -842,10 +842,12 @@ namespace ignition
>> d[12] >> d[13] >> d[14] >> d[15];

if (!_in.fail())
_m.Set(d[0], d[1], d[2], d[3],
d[4], d[5], d[6], d[7],
d[8], d[9], d[10], d[11],
d[12], d[13], d[14], d[15]);
{
_m.Set(d[0], d[1], d[2], d[3],
d[4], d[5], d[6], d[7],
d[8], d[9], d[10], d[11],
d[12], d[13], d[14], d[15]);
}
return _in;
}

Expand Down
5 changes: 4 additions & 1 deletion include/ignition/math/Quaternion.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,10 @@ namespace ignition
_in.setf(std::ios_base::skipws);
_in >> roll >> pitch >> yaw;

if (!_in.fail()) _q.Euler(Vector3<T>(*roll, *pitch, *yaw));
if (!_in.fail())
{
_q.Euler(Vector3<T>(*roll, *pitch, *yaw));
}

return _in;
}
Expand Down
5 changes: 4 additions & 1 deletion include/ignition/math/Temperature.hh
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ namespace ignition
double kelvin;
_in >> kelvin;

if (!_in.fail()) _temp.SetKelvin(kelvin);
if (!_in.fail())
{
_temp.SetKelvin(kelvin);
}
return _in;
}

Expand Down
5 changes: 4 additions & 1 deletion include/ignition/math/Vector2.hh
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,10 @@ namespace ignition
// Skip white spaces
_in.setf(std::ios_base::skipws);
_in >> x >> y;
if (!_in.fail()) _pt.Set(x, y);
if (!_in.fail())
{
_pt.Set(x, y);
}
return _in;
}

Expand Down
5 changes: 4 additions & 1 deletion include/ignition/math/Vector3.hh
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,10 @@ namespace ignition
_in.setf(std::ios_base::skipws);
T x, y, z;
_in >> x >> y >> z;
if (!_in.fail()) _pt.Set(x, y, z);
if (!_in.fail())
{
_pt.Set(x, y, z);
}
return _in;
}

Expand Down
5 changes: 4 additions & 1 deletion include/ignition/math/Vector4.hh
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,10 @@ namespace ignition
// Skip white spaces
_in.setf(std::ios_base::skipws);
_in >> x >> y >> z >> w;
if (!_in.fail()) _pt.Set(x, y, z, w);
if (!_in.fail())
{
_pt.Set(x, y, z, w);
}
return _in;
}

Expand Down

0 comments on commit e5f264b

Please sign in to comment.