Fixed signed/unsigned mismatch with the new precision code

This commit is contained in:
Jesse Beder
2012-01-11 16:50:06 -06:00
parent 0e61ddb6d9
commit 7ace0e93d2
3 changed files with 11 additions and 11 deletions

View File

@@ -265,17 +265,17 @@ namespace YAML
}
}
bool EmitterState::SetFloatPrecision(unsigned value, FMT_SCOPE scope)
bool EmitterState::SetFloatPrecision(int value, FMT_SCOPE scope)
{
if(value > std::numeric_limits<float>::digits10)
if(value < 0 || value > std::numeric_limits<float>::digits10)
return false;
_Set(m_floatPrecision, value, scope);
return true;
}
bool EmitterState::SetDoublePrecision(unsigned value, FMT_SCOPE scope)
bool EmitterState::SetDoublePrecision(int value, FMT_SCOPE scope)
{
if(value > std::numeric_limits<double>::digits10)
if(value < 0 || value > std::numeric_limits<double>::digits10)
return false;
_Set(m_doublePrecision, value, scope);
return true;