Skip to content

Commit

Permalink
Fix warnings generated by jbeder#438 (comparing unsigned value with <0).
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreitbart authored and jbeder committed Dec 3, 2016
1 parent 8ff7d76 commit e3492bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/emitterstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ void EmitterState::StartedScalar() {
void EmitterState::StartedGroup(GroupType::value type) {
StartedNode();

const std::size_t lastGroupIndent = (m_groups.empty() ? 0 : m_groups.back()->indent);
const std::size_t lastGroupIndent =
(m_groups.empty() ? 0 : m_groups.back()->indent);
m_curIndent += lastGroupIndent;

// TODO: Create move constructors for settings types to simplify transfer
Expand Down Expand Up @@ -348,14 +349,15 @@ bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) {
}

bool EmitterState::SetFloatPrecision(std::size_t value, FmtScope::value scope) {
if (value < 0 || value > std::numeric_limits<float>::digits10 + 1)
if (value > std::numeric_limits<float>::digits10 + 1)
return false;
_Set(m_floatPrecision, value, scope);
return true;
}

bool EmitterState::SetDoublePrecision(std::size_t value, FmtScope::value scope) {
if (value < 0 || value > std::numeric_limits<double>::digits10 + 1)
bool EmitterState::SetDoublePrecision(std::size_t value,
FmtScope::value scope) {
if (value > std::numeric_limits<double>::digits10 + 1)
return false;
_Set(m_doublePrecision, value, scope);
return true;
Expand Down

0 comments on commit e3492bb

Please sign in to comment.