aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-04-16 03:53:54 -0700
committerChris Robinson <[email protected]>2022-04-16 03:53:54 -0700
commitadccf0aec935ff9b30e57aa8f4a1eb006beb92c2 (patch)
treee22eb24966d515caefffc7135a9fb35dcb90858d /alc
parent4bfaf860bfc2575c7dcfa5192902bfef35a36234 (diff)
Use a bool type for boolean parameters
Diffstat (limited to 'alc')
-rw-r--r--alc/alc.cpp2
-rw-r--r--alc/alconfig.cpp2
-rw-r--r--alc/alconfig.h2
-rw-r--r--alc/device.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index ee89b60a..50cda827 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -2102,7 +2102,7 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
sample_delay += FrontStablizer::DelayLength;
}
- if(device->getConfigValueBool(nullptr, "dither", 1))
+ if(device->getConfigValueBool(nullptr, "dither", true))
{
int depth{device->configValue<int>(nullptr, "dither-depth").value_or(0)};
if(depth <= 0)
diff --git a/alc/alconfig.cpp b/alc/alconfig.cpp
index 60cb4daf..7c1eec6d 100644
--- a/alc/alconfig.cpp
+++ b/alc/alconfig.cpp
@@ -519,7 +519,7 @@ al::optional<bool> ConfigValueBool(const char *devName, const char *blockName, c
return al::nullopt;
}
-int GetConfigValueBool(const char *devName, const char *blockName, const char *keyName, int def)
+bool GetConfigValueBool(const char *devName, const char *blockName, const char *keyName, bool def)
{
if(const char *val{GetConfigValue(devName, blockName, keyName)})
return (al::strcasecmp(val, "on") == 0 || al::strcasecmp(val, "yes") == 0
diff --git a/alc/alconfig.h b/alc/alconfig.h
index 57733acb..df2830cc 100644
--- a/alc/alconfig.h
+++ b/alc/alconfig.h
@@ -7,7 +7,7 @@
void ReadALConfig();
-int GetConfigValueBool(const char *devName, const char *blockName, const char *keyName, int def);
+bool GetConfigValueBool(const char *devName, const char *blockName, const char *keyName, bool def);
al::optional<std::string> ConfigValueStr(const char *devName, const char *blockName, const char *keyName);
al::optional<int> ConfigValueInt(const char *devName, const char *blockName, const char *keyName);
diff --git a/alc/device.h b/alc/device.h
index 62ed0346..04931a5a 100644
--- a/alc/device.h
+++ b/alc/device.h
@@ -137,7 +137,7 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice>, DeviceBase {
void enumerateHrtfs();
- bool getConfigValueBool(const char *block, const char *key, int def)
+ bool getConfigValueBool(const char *block, const char *key, bool def)
{ return GetConfigValueBool(DeviceName.c_str(), block, key, def); }
template<typename T>