From 6a1670dbc31cc0e44178bbd9ad34ff0d5981a060 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Thu, 20 Dec 2012 21:19:49 +0400 Subject: Migrate to STL containers/algorithms. --- src/debug.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/debug.h') diff --git a/src/debug.h b/src/debug.h index 56952427c..1b14c4e0a 100644 --- a/src/debug.h +++ b/src/debug.h @@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "threads.h" #include "gettime.h" #include "exceptions.h" +#include #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -165,7 +166,7 @@ struct DebugStack int stack_max_i; // Highest i that was seen }; -extern core::map g_debug_stacks; +extern std::map g_debug_stacks; extern JMutex g_debug_stacks_mutex; extern void debug_stacks_init(); @@ -205,42 +206,42 @@ public: void add(u16 command) { - core::map::Node *n = m_packets.find(command); - if(n == NULL) + std::map::iterator n = m_packets.find(command); + if(n == m_packets.end()) { m_packets[command] = 1; } else { - n->setValue(n->getValue()+1); + n->second++; } } void clear() { - for(core::map::Iterator - i = m_packets.getIterator(); - i.atEnd() == false; i++) + for(std::map::iterator + i = m_packets.begin(); + i != m_packets.end(); ++i) { - i.getNode()->setValue(0); + i->second = 0; } } void print(std::ostream &o) { - for(core::map::Iterator - i = m_packets.getIterator(); - i.atEnd() == false; i++) + for(std::map::iterator + i = m_packets.begin(); + i != m_packets.end(); ++i) { - o<<"cmd "<getKey() - <<" count "<getValue() + o<<"cmd "<first + <<" count "<second < m_packets; + std::map m_packets; }; /* -- cgit v1.2.3