Eliminated MSVC warnings

This commit is contained in:
Andrey Guskov
2015-01-26 16:26:07 +04:00
parent 05a64f1302
commit ed53df90a4
10 changed files with 31 additions and 26 deletions

View File

@@ -37,6 +37,8 @@
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <cassert>
#include <iomanip>
#include "../timing.h"
@@ -61,9 +63,9 @@ static void progressBar(const int x, const int n, const int width = 50)
bstr += "]";
// print percentage
char pstr0[32];
sprintf(pstr0, " %2d %c ", static_cast<int>(f*100.0),'%');
const std::string pstr(pstr0);
std::stringstream pstr0;
pstr0 << " " << static_cast<int>(f*100.0) << " % ";
const std::string pstr(pstr0.str());
std::copy(pstr.begin(), pstr.end(), bstr.begin() + (width/2-2));
std::cout << bstr;