diff options
author | Chris Robinson <[email protected]> | 2019-06-30 13:04:23 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-30 16:40:08 -0700 |
commit | 0fc30151f2053346005ce9f15da38363a9e62313 (patch) | |
tree | 07f5d0edeffab0c84adab56b9ccca7cce55bc54a /Alc/alconfig.cpp | |
parent | 51f53afe12719513b3736a1c73e7de98d7e301ca (diff) |
Use an optional for ConfigValueUInt
Diffstat (limited to 'Alc/alconfig.cpp')
-rw-r--r-- | Alc/alconfig.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/alconfig.cpp b/Alc/alconfig.cpp index 00643043..8b299afc 100644 --- a/Alc/alconfig.cpp +++ b/Alc/alconfig.cpp @@ -509,13 +509,13 @@ al::optional<int> ConfigValueInt(const char *devName, const char *blockName, con return al::optional<int>{al::in_place, static_cast<int>(std::strtol(val, nullptr, 0))}; } -int ConfigValueUInt(const char *devName, const char *blockName, const char *keyName, unsigned int *ret) +al::optional<unsigned int> ConfigValueUInt(const char *devName, const char *blockName, const char *keyName) { const char *val = GetConfigValue(devName, blockName, keyName, ""); - if(!val[0]) return 0; + if(!val[0]) return al::nullopt; - *ret = std::strtoul(val, nullptr, 0); - return 1; + return al::optional<unsigned int>{al::in_place, + static_cast<unsigned int>(std::strtoul(val, nullptr, 0))}; } int ConfigValueFloat(const char *devName, const char *blockName, const char *keyName, float *ret) |