Skip to content

Commit 384b207

Browse files
[clang] Update format.
1 parent 873dafc commit 384b207

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

include/dynamic-graph/logger.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ namespace dynamicgraph {
6161
#define SEND_WARNING_STREAM_MSG(msg) SEND_MSG(msg, MSG_TYPE_WARNING_STREAM)
6262
#define SEND_ERROR_STREAM_MSG(msg) SEND_MSG(msg, MSG_TYPE_ERROR_STREAM)
6363

64-
template<typename T>
65-
std::string toString(const T& v, const int precision=3, const int width=-1)
66-
{
64+
template <typename T>
65+
std::string toString(const T &v, const int precision = 3,
66+
const int width = -1) {
6767
std::stringstream ss;
68-
if(width>precision)
69-
ss<<std::fixed<<std::setw(width)<<std::setprecision(precision)<<v;
68+
if (width > precision)
69+
ss << std::fixed << std::setw(width) << std::setprecision(precision) << v;
7070
else
71-
ss<<std::fixed<<std::setprecision(precision)<<v;
71+
ss << std::fixed << std::setprecision(precision) << v;
7272
return ss.str();
7373
}
7474

tests/debug-logger.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ class CustomEntity : public Entity {
5151
sendMsg("This is a message of level MSG_TYPE_ERROR_STREAM",
5252
MSG_TYPE_ERROR_STREAM);
5353
/* Add test toString */
54-
double q=1.0;
55-
sendMsg("Value to display: "+toString(q));
54+
double q = 1.0;
55+
sendMsg("Value to display: " + toString(q));
5656
std::vector<double> vq;
5757
vq.resize(3);
58-
vq[0] = 1.0; vq[1] = 2.0; vq[2] = 3.0;
59-
sendMsg("Value to display: "+toString(vq));
60-
Eigen::Matrix<double,3,3> an_eig_m;
58+
vq[0] = 1.0;
59+
vq[1] = 2.0;
60+
vq[2] = 3.0;
61+
sendMsg("Value to display: " + toString(vq));
62+
Eigen::Matrix<double, 3, 3> an_eig_m;
6163
an_eig_m.Ones();
62-
sendMsg("Value to display: "+toString(an_eig_m));
64+
sendMsg("Value to display: " + toString(an_eig_m));
6365
logger_.countdown();
6466
}
6567
};

0 commit comments

Comments
 (0)