1515#include < sstream>
1616
1717#include " sot/core/api.hh"
18+ #include " sot/core/fwd.hh"
1819
1920#ifndef VP_DEBUG_MODE
2021#define VP_DEBUG_MODE 0
@@ -37,17 +38,17 @@ namespace dynamicgraph {
3738namespace sot {
3839class SOT_CORE_EXPORT DebugTrace {
3940 public:
40- static const int SIZE = 512 ;
41+ static const size_type SIZE = 512 ;
4142
4243 std::stringstream tmpbuffer;
4344 std::ostream &outputbuffer;
4445 char charbuffer[SIZE + 1 ];
45- int traceLevel;
46- int traceLevelTemplate;
46+ size_type traceLevel;
47+ size_type traceLevelTemplate;
4748
4849 DebugTrace (std::ostream &os) : outputbuffer(os) {}
4950
50- inline void trace (const int level, const char *format, ...) {
51+ inline void trace (const size_type level, const char *format, ...) {
5152 if (level <= traceLevel) SOT_COMMON_TRACES;
5253 tmpbuffer.str (" " );
5354 }
@@ -57,12 +58,12 @@ class SOT_CORE_EXPORT DebugTrace {
5758 tmpbuffer.str (" " );
5859 }
5960
60- inline void trace (const int level = -1 ) {
61+ inline void trace (const size_type level = -1 ) {
6162 if (level <= traceLevel) outputbuffer << tmpbuffer.str ();
6263 tmpbuffer.str (" " );
6364 }
6465
65- inline void traceTemplate (const int level, const char *format, ...) {
66+ inline void traceTemplate (const size_type level, const char *format, ...) {
6667 if (level <= traceLevelTemplate) SOT_COMMON_TRACES;
6768 tmpbuffer.str (" " );
6869 }
@@ -74,7 +75,7 @@ class SOT_CORE_EXPORT DebugTrace {
7475
7576 inline DebugTrace &pre (const std::ostream &) { return *this ; }
7677
77- inline DebugTrace &pre (const std::ostream &, int level) {
78+ inline DebugTrace &pre (const std::ostream &, size_type level) {
7879 traceLevel = level;
7980 return *this ;
8081 }
@@ -150,9 +151,11 @@ SOT_CORE_EXPORT extern DebugTrace sotERRORFLOW;
150151
151152namespace dynamicgraph {
152153namespace sot {
153- inline bool sotDEBUG_ENABLE (const int &level) { return level <= VP_DEBUG_MODE; }
154+ inline bool sotDEBUG_ENABLE (const size_type &level) {
155+ return level <= VP_DEBUG_MODE;
156+ }
154157
155- inline bool sotTDEBUG_ENABLE (const int &level) {
158+ inline bool sotTDEBUG_ENABLE (const size_type &level) {
156159 return level <= VP_TEMPLATE_DEBUG_MODE;
157160}
158161} // namespace sot
@@ -176,9 +179,9 @@ inline bool sotTDEBUG_ENABLE(const int &level) {
176179
177180namespace dynamicgraph {
178181namespace sot {
179- inline void sotDEBUGF (const int , const char *, ...) {}
182+ inline void sotDEBUGF (const size_type , const char *, ...) {}
180183inline void sotDEBUGF (const char *, ...) {}
181- inline void sotERRORF (const int , const char *, ...) {}
184+ inline void sotERRORF (const size_type , const char *, ...) {}
182185inline void sotERRORF (const char *, ...) {}
183186inline std::ostream &__null_stream () {
184187 // This function should never be called. With -O3,
@@ -198,7 +201,7 @@ inline std::ostream &__null_stream() {
198201
199202namespace dynamicgraph {
200203namespace sot {
201- inline void sotTDEBUGF (const int , const char *, ...) {}
204+ inline void sotTDEBUGF (const size_type , const char *, ...) {}
202205inline void sotTDEBUGF (const char *, ...) {}
203206} // namespace sot
204207} // namespace dynamicgraph
0 commit comments