diff options
author | kcat <[email protected]> | 2018-10-29 10:10:06 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2018-10-29 10:10:06 -0700 |
commit | 44a4602508119b528fd290c8d6ff836a5a8db87f (patch) | |
tree | fd39c1d42c21eb751b1aa9696d7c758f6fc7d4de /Alc | |
parent | 56b8b976427175731b205262f11b420581e24efd (diff) | |
parent | 08226bc6b0147b69a1afb74d83c6a8821e93601b (diff) |
Merge pull request #240 from ShFil119/impr/simplify_statements
Simplify some statements
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alconfig.c | 4 | ||||
-rw-r--r-- | Alc/helpers.c | 2 | ||||
-rw-r--r-- | Alc/panning.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Alc/alconfig.c b/Alc/alconfig.c index 3d0ed140..050391af 100644 --- a/Alc/alconfig.c +++ b/Alc/alconfig.c @@ -635,7 +635,7 @@ const char *GetConfigValue(const char *devName, const char *blockName, const cha int ConfigValueExists(const char *devName, const char *blockName, const char *keyName) { const char *val = GetConfigValue(devName, blockName, keyName, ""); - return !!val[0]; + return val[0] != 0; } int ConfigValueStr(const char *devName, const char *blockName, const char *keyName, const char **ret) @@ -692,7 +692,7 @@ int GetConfigValueBool(const char *devName, const char *blockName, const char *k { const char *val = GetConfigValue(devName, blockName, keyName, ""); - if(!val[0]) return !!def; + if(!val[0]) return def != 0; return (strcasecmp(val, "true") == 0 || strcasecmp(val, "yes") == 0 || strcasecmp(val, "on") == 0 || atoi(val) != 0); } diff --git a/Alc/helpers.c b/Alc/helpers.c index d2cb6253..0d5087e6 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -842,7 +842,7 @@ static void DirectorySearch(const char *path, const char *ext, vector_al_string continue; len = strlen(dirent->d_name); - if(!(len > extlen)) + if(len <= extlen) continue; if(strcasecmp(dirent->d_name+len-extlen, ext) != 0) continue; diff --git a/Alc/panning.c b/Alc/panning.c index 2c0f3bf2..79627e78 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -730,7 +730,7 @@ static void InitHQPanning(ALCdevice *device, const AmbDecConf *conf, const ALsiz ); bformatdec_reset(device->AmbiDecoder, conf, count, device->Frequency, speakermap); - if(!(conf->ChanMask > 0xf)) + if(conf->ChanMask <= 0xf) { device->FOAOut.Ambi = device->Dry.Ambi; device->FOAOut.CoeffCount = device->Dry.CoeffCount; |