Skip to content

Commit

Permalink
fixed signed/unsigned comparison warning picked up by Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
sjneph committed Jul 17, 2017
1 parent 3800d8d commit 49fa910
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions interfaces/general-headers/data/bed/Bed.hpp
Expand Up @@ -470,7 +470,7 @@ namespace Bed {
&start_, &end_, id_,
other);
const int numWritten = std::snprintf(fullrest_, MAXRESTSIZE+1, "\t%s", id_);
if ( other[0] != '\0' && numWritten < MAXRESTSIZE )
if ( other[0] != '\0' && static_cast<CoordType>(numWritten) < MAXRESTSIZE )
std::snprintf(fullrest_ + numWritten, MAXRESTSIZE+1-numWritten, "%s", other);
return numScanned;
}
Expand All @@ -489,7 +489,7 @@ namespace Bed {

std::fgetc(inputFile); // Read and discard trailing newline
const int numWritten = std::snprintf(fullrest_, MAXRESTSIZE+1, "\t%s", id_);
if ( other[0] != '\0' && numWritten < MAXRESTSIZE )
if ( other[0] != '\0' && static_cast<CoordType>(numWritten) < MAXRESTSIZE )
std::snprintf(fullrest_ + numWritten, MAXRESTSIZE+1-numWritten, "%s", other);
return numScanned;
}
Expand Down Expand Up @@ -670,7 +670,7 @@ namespace Bed {
&measurement_, other);

const int numWritten = std::snprintf(fullrest_, MAXRESTSIZE+1, (std::string("\t%s\t") + BaseClass::MFormat).c_str(), id_, measurement_);
if ( other[0] != '\0' && numWritten < MAXRESTSIZE ) {
if ( other[0] != '\0' && static_cast<CoordType>(numWritten) < MAXRESTSIZE ) {
restOffset_ = numWritten;
std::snprintf(fullrest_ + numWritten, MAXRESTSIZE+1-numWritten, "%s", other);
}
Expand All @@ -694,7 +694,7 @@ namespace Bed {

static const char* f = (std::string("\t%s\t") + BaseClass::MFormat).c_str();
const int numWritten = std::snprintf(fullrest_, MAXRESTSIZE+1, f, id_, measurement_);
if ( other[0] != '\0' && numWritten < MAXRESTSIZE ) {
if ( other[0] != '\0' && static_cast<CoordType>(numWritten) < MAXRESTSIZE ) {
restOffset_ = numWritten;
std::snprintf(fullrest_ + numWritten, MAXRESTSIZE+1-numWritten, "%s", other);
}
Expand Down

0 comments on commit 49fa910

Please sign in to comment.