From 178f4811e8602ba7dacb1a0513baa546088d517d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 Feb 2012 02:13:16 +0300 Subject: Fix compilation errors and more style. --- src/configuration.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/configuration.cpp') diff --git a/src/configuration.cpp b/src/configuration.cpp index 254a3fea8..c4f1cc360 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -193,21 +193,21 @@ int Configuration::getIntValue(const std::string &key) const if (itdef != mDefaultsData->end() && itdef->second) { - if (itdef->second->getType() == Mana::VariableData::DATA_INT) + if (itdef->second->getType() == VariableData::DATA_INT) { - defaultValue = (static_cast( + defaultValue = (static_cast( itdef->second))->getData(); } else if (itdef->second->getType() - == Mana::VariableData::DATA_STRING) + == VariableData::DATA_STRING) { - defaultValue = atoi((static_cast( + defaultValue = atoi((static_cast( itdef->second))->getData().c_str()); } else if (itdef->second->getType() - == Mana::VariableData::DATA_BOOL) + == VariableData::DATA_BOOL) { - if ((static_cast( + if ((static_cast( itdef->second))->getData()) { defaultValue = 1; @@ -241,9 +241,9 @@ int Configuration::resetIntValue(const std::string &key) DefaultsData::const_iterator itdef = mDefaultsData->find(key); if (itdef != mDefaultsData->end() && itdef->second - && itdef->second->getType() == Mana::VariableData::DATA_INT) + && itdef->second->getType() == VariableData::DATA_INT) { - defaultValue = (static_cast( + defaultValue = (static_cast( itdef->second))->getData(); } else @@ -270,15 +270,15 @@ std::string Configuration::getStringValue(const std::string &key) const if (itdef != mDefaultsData->end() && itdef->second) { if (itdef->second->getType() - == Mana::VariableData::DATA_STRING) + == VariableData::DATA_STRING) { - defaultValue = (static_cast( + defaultValue = (static_cast( itdef->second))->getData(); } else if (itdef->second->getType() - == Mana::VariableData::DATA_BOOL) + == VariableData::DATA_BOOL) { - if ((static_cast( + if ((static_cast( itdef->second))->getData()) { defaultValue = "1"; @@ -289,9 +289,9 @@ std::string Configuration::getStringValue(const std::string &key) const } } else if (itdef->second->getType() - == Mana::VariableData::DATA_INT) + == VariableData::DATA_INT) { - defaultValue = toString((static_cast( + defaultValue = toString((static_cast( itdef->second))->getData()); } } @@ -322,10 +322,10 @@ float Configuration::getFloatValue(const std::string &key) const DefaultsData::const_iterator itdef = mDefaultsData->find(key); if (itdef != mDefaultsData->end() && itdef->second - && itdef->second->getType() == Mana::VariableData::DATA_FLOAT) + && itdef->second->getType() == VariableData::DATA_FLOAT) { defaultValue = static_cast( - (static_cast(itdef->second))->getData()); + (static_cast(itdef->second))->getData()); } else { @@ -354,15 +354,15 @@ bool Configuration::getBoolValue(const std::string &key) const if (itdef != mDefaultsData->end() && itdef->second) { - if (itdef->second->getType() == Mana::VariableData::DATA_BOOL) + if (itdef->second->getType() == VariableData::DATA_BOOL) { - defaultValue = (static_cast( + defaultValue = (static_cast( itdef->second))->getData(); } else if (itdef->second->getType() - == Mana::VariableData::DATA_INT) + == VariableData::DATA_INT) { - if ((static_cast( + if ((static_cast( itdef->second))->getData() != 0) { defaultValue = true; @@ -373,9 +373,9 @@ bool Configuration::getBoolValue(const std::string &key) const } } else if (itdef->second->getType() - == Mana::VariableData::DATA_STRING) + == VariableData::DATA_STRING) { - if ((static_cast( + if ((static_cast( itdef->second))->getData() != "0") { defaultValue = true; @@ -410,9 +410,9 @@ bool Configuration::resetBoolValue(const std::string &key) DefaultsData::const_iterator itdef = mDefaultsData->find(key); if (itdef != mDefaultsData->end() && itdef->second - && itdef->second->getType() == Mana::VariableData::DATA_BOOL) + && itdef->second->getType() == VariableData::DATA_BOOL) { - defaultValue = (static_cast( + defaultValue = (static_cast( itdef->second))->getData(); } else -- cgit v1.2.3-70-g09d2