diff options
Diffstat (limited to 'Alc/alconfig.cpp')
-rw-r--r-- | Alc/alconfig.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/alconfig.cpp b/Alc/alconfig.cpp index b6e406fd..5f5f9149 100644 --- a/Alc/alconfig.cpp +++ b/Alc/alconfig.cpp @@ -497,7 +497,7 @@ al::optional<std::string> ConfigValueStr(const char *devName, const char *blockN const char *val = GetConfigValue(devName, blockName, keyName, ""); if(!val[0]) return al::nullopt; - return al::optional<std::string>{val}; + return al::make_optional<std::string>(val); } al::optional<int> ConfigValueInt(const char *devName, const char *blockName, const char *keyName) @@ -505,7 +505,7 @@ al::optional<int> ConfigValueInt(const char *devName, const char *blockName, con const char *val = GetConfigValue(devName, blockName, keyName, ""); if(!val[0]) return al::nullopt; - return al::optional<int>{static_cast<int>(std::strtol(val, nullptr, 0))}; + return al::make_optional(static_cast<int>(std::strtol(val, nullptr, 0))); } al::optional<unsigned int> ConfigValueUInt(const char *devName, const char *blockName, const char *keyName) @@ -513,7 +513,7 @@ al::optional<unsigned int> ConfigValueUInt(const char *devName, const char *bloc const char *val = GetConfigValue(devName, blockName, keyName, ""); if(!val[0]) return al::nullopt; - return al::optional<unsigned int>{static_cast<unsigned int>(std::strtoul(val, nullptr, 0))}; + return al::make_optional(static_cast<unsigned int>(std::strtoul(val, nullptr, 0))); } al::optional<float> ConfigValueFloat(const char *devName, const char *blockName, const char *keyName) @@ -521,7 +521,7 @@ al::optional<float> ConfigValueFloat(const char *devName, const char *blockName, const char *val = GetConfigValue(devName, blockName, keyName, ""); if(!val[0]) return al::nullopt; - return al::optional<float>{std::strtof(val, nullptr)}; + return al::make_optional(std::strtof(val, nullptr)); } al::optional<bool> ConfigValueBool(const char *devName, const char *blockName, const char *keyName) @@ -529,9 +529,9 @@ al::optional<bool> ConfigValueBool(const char *devName, const char *blockName, c const char *val = GetConfigValue(devName, blockName, keyName, ""); if(!val[0]) return al::nullopt; - return al::optional<bool>{ + return al::make_optional( strcasecmp(val, "true") == 0 || strcasecmp(val, "yes") == 0 || - strcasecmp(val, "on") == 0 || atoi(val) != 0}; + strcasecmp(val, "on") == 0 || atoi(val) != 0); } int GetConfigValueBool(const char *devName, const char *blockName, const char *keyName, int def) |