mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
silence gcc warnings
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
#include "Poco/Stopwatch.h"
|
#include "Poco/Stopwatch.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
|
||||||
using Poco::trimLeft;
|
using Poco::trimLeft;
|
||||||
@@ -590,7 +591,6 @@ void StringTest::testNumericLocale()
|
|||||||
void StringTest::benchmarkStrToInt()
|
void StringTest::benchmarkStrToInt()
|
||||||
{
|
{
|
||||||
Poco::Stopwatch sw;
|
Poco::Stopwatch sw;
|
||||||
int number = 123456789;
|
|
||||||
std::string num = "123456789";
|
std::string num = "123456789";
|
||||||
int res;
|
int res;
|
||||||
sw.start();
|
sw.start();
|
||||||
@@ -613,7 +613,7 @@ void StringTest::benchmarkStrToInt()
|
|||||||
double timeStrToInt = sw.elapsed() / 1000.0;
|
double timeStrToInt = sw.elapsed() / 1000.0;
|
||||||
|
|
||||||
sw.restart();
|
sw.restart();
|
||||||
for (int i = 0; i < 1000000; ++i) std::sscanf(num.c_str(), "%d%c", &res);
|
for (int i = 0; i < 1000000; ++i) std::sscanf(num.c_str(), "%d", &res);
|
||||||
sw.stop();
|
sw.stop();
|
||||||
std::cout << "sscanf Number: " << res << std::endl;
|
std::cout << "sscanf Number: " << res << std::endl;
|
||||||
double timeScanf = sw.elapsed() / 1000.0;
|
double timeScanf = sw.elapsed() / 1000.0;
|
||||||
@@ -640,7 +640,6 @@ void StringTest::benchmarkStrToInt()
|
|||||||
void StringTest::benchmarkStrToFloat()
|
void StringTest::benchmarkStrToFloat()
|
||||||
{
|
{
|
||||||
Poco::Stopwatch sw;
|
Poco::Stopwatch sw;
|
||||||
double number = 1.23456e-123;
|
|
||||||
std::string num = "1.23456e-123";
|
std::string num = "1.23456e-123";
|
||||||
double res;
|
double res;
|
||||||
sw.start();
|
sw.start();
|
||||||
@@ -664,7 +663,7 @@ void StringTest::benchmarkStrToFloat()
|
|||||||
double timeStrToFloat = sw.elapsed() / 1000.0;
|
double timeStrToFloat = sw.elapsed() / 1000.0;
|
||||||
|
|
||||||
sw.restart();
|
sw.restart();
|
||||||
for (int i = 0; i < 1000000; ++i) std::sscanf(num.c_str(), "%f%c", &res);
|
for (int i = 0; i < 1000000; ++i) std::sscanf(num.c_str(), "%lf", &res);
|
||||||
sw.stop();
|
sw.stop();
|
||||||
std::cout << "sscanf Number: " << res << std::endl;
|
std::cout << "sscanf Number: " << res << std::endl;
|
||||||
double timeScanf = sw.elapsed() / 1000.0;
|
double timeScanf = sw.elapsed() / 1000.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user