Skip to content

Commit

Permalink
Solve throughput test compiler warning in Windows (#960)
Browse files Browse the repository at this point in the history
* Solve "warning C4389: '==': signed/unsigned mismatch"

* Check if recovery < 0 with int32_t

* Correct trace
  • Loading branch information
EduPonz authored and MiguelCompany committed Jan 21, 2020
1 parent f3863b6 commit 05e3e3e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/performance/throughput/ThroughputPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ bool ThroughputPublisher::load_recoveries()
std::string line;
size_t start;
size_t end;
int32_t recovery;
uint32_t recovery;
int32_t input_recovery;
bool more = true;
while (std::getline(fi, line))
{
Expand All @@ -770,12 +771,13 @@ bool ThroughputPublisher::load_recoveries()
while (more)
{
std::istringstream iss(line.substr(start, end - start));
iss >> recovery;
if (recovery < 0)
iss >> input_recovery;
if (input_recovery < 0)
{
std::cout << "Recovery times must be positive. " << recovery << " found" << std::endl;
std::cout << "Recovery times must be positive. " << input_recovery << " found" << std::endl;
return false;
}
recovery = static_cast<uint32_t>(input_recovery);
// Only add if it was not there already
if (std::find(recovery_times_.begin(), recovery_times_.end(), recovery) == recovery_times_.end())
{
Expand Down

0 comments on commit 05e3e3e

Please sign in to comment.