mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Fix warnings generated by #438 (comparing unsigned value with <0).
This commit is contained in:

committed by
Jesse Beder

parent
8ff7d76e19
commit
e3492bb3fa
@@ -124,7 +124,8 @@ void EmitterState::StartedScalar() {
|
|||||||
void EmitterState::StartedGroup(GroupType::value type) {
|
void EmitterState::StartedGroup(GroupType::value type) {
|
||||||
StartedNode();
|
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;
|
m_curIndent += lastGroupIndent;
|
||||||
|
|
||||||
// TODO: Create move constructors for settings types to simplify transfer
|
// TODO: Create move constructors for settings types to simplify transfer
|
||||||
@@ -348,14 +349,15 @@ bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EmitterState::SetFloatPrecision(std::size_t 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;
|
return false;
|
||||||
_Set(m_floatPrecision, value, scope);
|
_Set(m_floatPrecision, value, scope);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmitterState::SetDoublePrecision(std::size_t value, FmtScope::value scope) {
|
bool EmitterState::SetDoublePrecision(std::size_t value,
|
||||||
if (value < 0 || value > std::numeric_limits<double>::digits10 + 1)
|
FmtScope::value scope) {
|
||||||
|
if (value > std::numeric_limits<double>::digits10 + 1)
|
||||||
return false;
|
return false;
|
||||||
_Set(m_doublePrecision, value, scope);
|
_Set(m_doublePrecision, value, scope);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user