aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Gawin <[email protected]>2018-10-29 02:05:45 +0100
committerFilip Gawin <[email protected]>2018-10-29 13:38:58 +0100
commit08226bc6b0147b69a1afb74d83c6a8821e93601b (patch)
treefd39c1d42c21eb751b1aa9696d7c758f6fc7d4de
parent56b8b976427175731b205262f11b420581e24efd (diff)
Simplify some statements
-rw-r--r--Alc/alconfig.c4
-rw-r--r--Alc/helpers.c2
-rw-r--r--Alc/panning.c2
-rw-r--r--OpenAL32/alAuxEffectSlot.c4
-rw-r--r--OpenAL32/alBuffer.c2
-rw-r--r--OpenAL32/alEffect.c4
-rw-r--r--OpenAL32/alFilter.c4
-rw-r--r--OpenAL32/alSource.c24
-rw-r--r--common/uintmap.c6
-rw-r--r--examples/alrecord.c10
-rw-r--r--router/router.c6
-rw-r--r--utils/alsoft-config/mainwindow.cpp2
12 files changed, 35 insertions, 35 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;
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 8141e0f6..e1d84bb9 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -116,7 +116,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
context = GetContextRef();
if(!context) return;
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Generating %d effect slots", n);
if(n == 0) goto done;
@@ -179,7 +179,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *
if(!context) return;
LockEffectSlotList(context);
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d effect slots", n);
if(n == 0) goto done;
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index ed712434..0b8c27f5 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -77,7 +77,7 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
context = GetContextRef();
if(!context) return;
- if(!(n >= 0))
+ if(n < 0)
alSetError(context, AL_INVALID_VALUE, "Generating %d buffers", n);
else for(cur = 0;cur < n;cur++)
{
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c
index c2a78a0c..05a6c0a3 100644
--- a/OpenAL32/alEffect.c
+++ b/OpenAL32/alEffect.c
@@ -81,7 +81,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
context = GetContextRef();
if(!context) return;
- if(!(n >= 0))
+ if(n < 0)
alSetError(context, AL_INVALID_VALUE, "Generating %d effects", n);
else for(cur = 0;cur < n;cur++)
{
@@ -109,7 +109,7 @@ AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects)
device = context->Device;
LockEffectList(device);
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d effects", n);
for(i = 0;i < n;i++)
{
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index e57653e0..01da4008 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -61,7 +61,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
context = GetContextRef();
if(!context) return;
- if(!(n >= 0))
+ if(n < 0)
alSetError(context, AL_INVALID_VALUE, "Generating %d filters", n);
else for(cur = 0;cur < n;cur++)
{
@@ -90,7 +90,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters)
device = context->Device;
LockFilterList(device);
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d filters", n);
for(i = 0;i < n;i++)
{
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index d7c68e4e..2e3a0e2a 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -988,7 +988,7 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid effect ID %u",
values[0]);
}
- if(!((ALuint)values[1] < (ALuint)device->NumAuxSends))
+ if((ALuint)values[1] >= (ALuint)device->NumAuxSends)
{
UnlockEffectSlotList(Context);
SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid send %u", values[1]);
@@ -1683,7 +1683,7 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
context = GetContextRef();
if(!context) return;
- if(!(n >= 0))
+ if(n < 0)
alSetError(context, AL_INVALID_VALUE, "Generating %d sources", n);
else for(cur = 0;cur < n;cur++)
{
@@ -1710,7 +1710,7 @@ AL_API ALvoid AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
if(!context) return;
LockSourceList(context);
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d sources", n);
/* Check that all Sources are valid */
@@ -1761,7 +1761,7 @@ AL_API ALvoid AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value)
LockSourceList(Context);
if((Source=LookupSource(Context, source)) == NULL)
alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
- else if(!(FloatValsByProp(param) == 1))
+ else if(FloatValsByProp(param) != 1)
alSetError(Context, AL_INVALID_ENUM, "Invalid float property 0x%04x", param);
else
SetSourcefv(Source, Context, param, &value);
@@ -1783,7 +1783,7 @@ AL_API ALvoid AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1
LockSourceList(Context);
if((Source=LookupSource(Context, source)) == NULL)
alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
- else if(!(FloatValsByProp(param) == 3))
+ else if(FloatValsByProp(param) != 3)
alSetError(Context, AL_INVALID_ENUM, "Invalid 3-float property 0x%04x", param);
else
{
@@ -1810,7 +1810,7 @@ AL_API ALvoid AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat
alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
- else if(!(FloatValsByProp(param) > 0))
+ else if(FloatValsByProp(param) <= 0)
alSetError(Context, AL_INVALID_ENUM, "Invalid float-vector property 0x%04x", param);
else
SetSourcefv(Source, Context, param, values);
@@ -1833,7 +1833,7 @@ AL_API ALvoid AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble va
LockSourceList(Context);
if((Source=LookupSource(Context, source)) == NULL)
alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
- else if(!(DoubleValsByProp(param) == 1))
+ else if(DoubleValsByProp(param) != 1)
alSetError(Context, AL_INVALID_ENUM, "Invalid double property 0x%04x", param);
else
{
@@ -1858,7 +1858,7 @@ AL_API ALvoid AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble v
LockSourceList(Context);
if((Source=LookupSource(Context, source)) == NULL)
alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
- else if(!(DoubleValsByProp(param) == 3))
+ else if(DoubleValsByProp(param) != 3)
alSetError(Context, AL_INVALID_ENUM, "Invalid 3-double property 0x%04x", param);
else
{
@@ -1916,7 +1916,7 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value)
LockSourceList(Context);
if((Source=LookupSource(Context, source)) == NULL)
alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
- else if(!(IntValsByProp(param) == 1))
+ else if(IntValsByProp(param) != 1)
alSetError(Context, AL_INVALID_ENUM, "Invalid integer property 0x%04x", param);
else
SetSourceiv(Source, Context, param, &value);
@@ -2568,7 +2568,7 @@ AL_API ALvoid AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources)
if(!context) return;
LockSourceList(context);
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Pausing %d sources", n);
for(i = 0;i < n;i++)
{
@@ -2612,7 +2612,7 @@ AL_API ALvoid AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources)
if(!context) return;
LockSourceList(context);
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Stopping %d sources", n);
for(i = 0;i < n;i++)
{
@@ -2664,7 +2664,7 @@ AL_API ALvoid AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources)
if(!context) return;
LockSourceList(context);
- if(!(n >= 0))
+ if(n < 0)
SETERR_GOTO(context, AL_INVALID_VALUE, done, "Rewinding %d sources", n);
for(i = 0;i < n;i++)
{
diff --git a/common/uintmap.c b/common/uintmap.c
index 18d52d64..3654779c 100644
--- a/common/uintmap.c
+++ b/common/uintmap.c
@@ -47,7 +47,7 @@ ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value)
do {
ALsizei step = count>>1;
ALsizei i = pos+step;
- if(!(map->keys[i] < key))
+ if(map->keys[i] >= key)
count = step;
else
{
@@ -130,7 +130,7 @@ ALvoid *RemoveUIntMapKey(UIntMap *map, ALuint key)
do {
ALsizei step = count>>1;
ALsizei i = pos+step;
- if(!(map->keys[i] < key))
+ if(map->keys[i] >= key)
count = step;
else
{
@@ -166,7 +166,7 @@ ALvoid *LookupUIntMapKey(UIntMap *map, ALuint key)
do {
ALsizei step = count>>1;
ALsizei i = pos+step;
- if(!(map->keys[i] < key))
+ if(map->keys[i] >= key)
count = step;
else
{
diff --git a/examples/alrecord.c b/examples/alrecord.c
index 43b26d35..f60a3055 100644
--- a/examples/alrecord.c
+++ b/examples/alrecord.c
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
break;
else if(strcmp(argv[0], "--channels") == 0 || strcmp(argv[0], "-c") == 0)
{
- if(!(argc > 1))
+ if(argc < 2)
{
fprintf(stderr, "Missing argument for option: %s\n", argv[0]);
return 1;
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
}
else if(strcmp(argv[0], "--bits") == 0 || strcmp(argv[0], "-b") == 0)
{
- if(!(argc > 1))
+ if(argc < 2)
{
fprintf(stderr, "Missing argument for option: %s\n", argv[0]);
return 1;
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
}
else if(strcmp(argv[0], "--rate") == 0 || strcmp(argv[0], "-r") == 0)
{
- if(!(argc > 1))
+ if(argc < 2)
{
fprintf(stderr, "Missing argument for option: %s\n", argv[0]);
return 1;
@@ -185,7 +185,7 @@ int main(int argc, char **argv)
}
else if(strcmp(argv[0], "--time") == 0 || strcmp(argv[0], "-t") == 0)
{
- if(!(argc > 1))
+ if(argc < 2)
{
fprintf(stderr, "Missing argument for option: %s\n", argv[0]);
return 1;
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
}
else if(strcmp(argv[0], "--outfile") == 0 || strcmp(argv[0], "-o") == 0)
{
- if(!(argc > 1))
+ if(argc < 2)
{
fprintf(stderr, "Missing argument for option: %s\n", argv[0]);
return 1;
diff --git a/router/router.c b/router/router.c
index bff73776..9d4346a8 100644
--- a/router/router.c
+++ b/router/router.c
@@ -419,7 +419,7 @@ ALenum InsertPtrIntMapEntry(PtrIntMap *map, ALvoid *key, ALint value)
do {
ALsizei step = count>>1;
ALsizei i = pos+step;
- if(!(map->keys[i] < key))
+ if(map->keys[i] >= key)
count = step;
else
{
@@ -485,7 +485,7 @@ ALint RemovePtrIntMapKey(PtrIntMap *map, ALvoid *key)
do {
ALsizei step = count>>1;
ALsizei i = pos+step;
- if(!(map->keys[i] < key))
+ if(map->keys[i] >= key)
count = step;
else
{
@@ -521,7 +521,7 @@ ALint LookupPtrIntMapKey(PtrIntMap *map, ALvoid *key)
do {
ALsizei step = count>>1;
ALsizei i = pos+step;
- if(!(map->keys[i] < key))
+ if(map->keys[i] >= key)
count = step;
else
{
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index 110fe4ed..56ac4f3f 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -916,7 +916,7 @@ void MainWindow::saveConfig(const QString &fname) const
settings.setValue("channels", getValueFromName(speakerModeList, ui->channelConfigCombo->currentText()));
uint rate = ui->sampleRateCombo->currentText().toUInt();
- if(!(rate > 0))
+ if(rate <= 0)
settings.setValue("frequency", QString());
else
settings.setValue("frequency", rate);