Variety of small or trivial simplifications to the code, completely eliminated
[oota-llvm.git] / lib / Support / Statistic.cpp
index b6c75c2adee49e5048bf8d27ead48b5f3144801a..6345fbfcfcf83a57aeb7964af1280689376b06c2 100644 (file)
@@ -18,6 +18,7 @@
 #include "Support/CommandLine.h"
 #include <iostream>
 #include <sstream>
+#include <algorithm>
 
 bool DebugFlag;  // DebugFlag - Exported boolean set by the -debug option
 
@@ -70,8 +71,10 @@ void StatisticBase::destroy() const {
     // Figure out how long the biggest Value and Name fields are...
     unsigned MaxNameLen = 0, MaxValLen = 0;
     for (unsigned i = 0, e = AccumStats->size(); i != e; ++i) {
-      MaxValLen = std::max(MaxValLen, (*AccumStats)[i].Value.length());
-      MaxNameLen = std::max(MaxNameLen, std::strlen((*AccumStats)[i].Name));
+      MaxValLen = std::max(MaxValLen, 
+                           (unsigned)(*AccumStats)[i].Value.length());
+      MaxNameLen = std::max(MaxNameLen, 
+                            (unsigned)std::strlen((*AccumStats)[i].Name));
     }
 
     // Sort the fields...