]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
clang compiler warnings: Fix -Wparantheses-equality warnings
authorMatthew Jordan <mjordan@digium.com>
Sat, 28 Mar 2015 12:39:08 +0000 (12:39 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sat, 28 Mar 2015 12:39:08 +0000 (12:39 +0000)
Clang will treat ((a == b)) as a warning, as it reasonably expects that the
developer may have intended to write (a == b) or ((a = b)). This patch cleans
up all instances where equality, not assignment, was intended between two
parantheses.

Review: https://reviewboard.asterisk.org/r/4531/

ASTERISK-24917
Repoted by: dkdegroot
patches:
  rb4531.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433687 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dictate.c
apps/app_voicemail.c
main/channel.c
res/Makefile
utils/Makefile

index 1820a1f83093dc87f882997a33688b04cbe94c84..e379a39f6043c3cd8b05837d2deea7e6a599f2c4 100644 (file)
@@ -174,7 +174,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data)
                                ast_queue_frame(chan, &fr);
                                digit = 0;
                        }
-                       if ((f->frametype == AST_FRAME_DTMF)) {
+                       if (f->frametype == AST_FRAME_DTMF) {
                                int got = 1;
                                switch(mode) {
                                case DMODE_PLAY:
index 3d1f291be1ccea0bb251eac1ed73c4761fd0b0dd..9bb0d9ecc7cf2a2debe11062df15b5de2b3ef535 100644 (file)
@@ -8968,7 +8968,7 @@ static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
                if (!res) 
                        res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
                if (!res) {
-                       if ((vms->newmessages == 1)) {
+                       if (vms->newmessages == 1) {
                                res = ast_play_and_wait(chan, "vm-INBOX");
                                if (!res)
                                        res = ast_play_and_wait(chan, "vm-message");
@@ -8982,7 +8982,7 @@ static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
                res = ast_play_and_wait(chan, "vm-youhave");
                if (!res)
                        res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
-               if ((vms->oldmessages == 1)){
+               if (vms->oldmessages == 1){
                        res = ast_play_and_wait(chan, "vm-Old");
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-message");
@@ -9174,7 +9174,7 @@ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
                        if ((vms->oldmessages || vms->newmessages) && !res) {
                                res = ast_play_and_wait(chan, "vm-and");
                        } else if (!res) {
-                               if ((vms->urgentmessages == 1))
+                               if (vms->urgentmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-message");
                                else
                                        res = ast_play_and_wait(chan, "vm-messages");
@@ -9187,7 +9187,7 @@ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
                        if (vms->oldmessages && !res)
                                res = ast_play_and_wait(chan, "vm-and");
                        else if (!res) {
-                               if ((vms->newmessages == 1))
+                               if (vms->newmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-message");
                                else
                                        res = ast_play_and_wait(chan, "vm-messages");
@@ -9339,7 +9339,7 @@ static int vm_intro_se(struct ast_channel *chan, struct vm_state *vms)
        }
 
        if (vms->newmessages) {
-               if ((vms->newmessages == 1)) {
+               if (vms->newmessages == 1) {
                        res = ast_play_and_wait(chan, "digits/ett");
                        res = res ? res : ast_play_and_wait(chan, "vm-nytt");
                        res = res ? res : ast_play_and_wait(chan, "vm-message");
@@ -9383,7 +9383,7 @@ static int vm_intro_no(struct ast_channel *chan, struct vm_state *vms)
        }
 
        if (vms->newmessages) {
-               if ((vms->newmessages == 1)) {
+               if (vms->newmessages == 1) {
                        res = ast_play_and_wait(chan, "digits/1");
                        res = res ? res : ast_play_and_wait(chan, "vm-ny");
                        res = res ? res : ast_play_and_wait(chan, "vm-message");
@@ -9418,7 +9418,7 @@ static int vm_intro_de(struct ast_channel *chan, struct vm_state *vms)
        res = ast_play_and_wait(chan, "vm-youhave");
        if (!res) {
                if (vms->newmessages) {
-                       if ((vms->newmessages == 1))
+                       if (vms->newmessages == 1)
                                res = ast_play_and_wait(chan, "digits/1F");
                        else
                                res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
@@ -9427,7 +9427,7 @@ static int vm_intro_de(struct ast_channel *chan, struct vm_state *vms)
                        if (vms->oldmessages && !res)
                                res = ast_play_and_wait(chan, "vm-and");
                        else if (!res) {
-                               if ((vms->newmessages == 1))
+                               if (vms->newmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-message");
                                else
                                        res = ast_play_and_wait(chan, "vm-messages");
@@ -9474,7 +9474,7 @@ static int vm_intro_es(struct ast_channel *chan, struct vm_state *vms)
        if (!res) {
                if (vms->newmessages) {
                        if (!res) {
-                               if ((vms->newmessages == 1)) {
+                               if (vms->newmessages == 1) {
                                        res = ast_play_and_wait(chan, "digits/1M");
                                        if (!res)
                                                res = ast_play_and_wait(chan, "vm-message");
@@ -9525,7 +9525,7 @@ static int vm_intro_pt_BR(struct ast_channel *chan, struct vm_state *vms) {
        if (vms->newmessages) {
                if (!res)
                        res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
-               if ((vms->newmessages == 1)) {
+               if (vms->newmessages == 1) {
                        if (!res)
                                res = ast_play_and_wait(chan, "vm-message");
                        if (!res)
@@ -9571,7 +9571,7 @@ static int vm_intro_fr(struct ast_channel *chan, struct vm_state *vms)
                        if (vms->oldmessages && !res)
                                res = ast_play_and_wait(chan, "vm-and");
                        else if (!res) {
-                               if ((vms->newmessages == 1))
+                               if (vms->newmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-message");
                                else
                                        res = ast_play_and_wait(chan, "vm-messages");
@@ -9618,7 +9618,7 @@ static int vm_intro_nl(struct ast_channel *chan, struct vm_state *vms)
                        if (vms->oldmessages && !res)
                                res = ast_play_and_wait(chan, "vm-and");
                        else if (!res) {
-                               if ((vms->newmessages == 1))
+                               if (vms->newmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-message");
                                else
                                        res = ast_play_and_wait(chan, "vm-messages");
@@ -9661,7 +9661,7 @@ static int vm_intro_pt(struct ast_channel *chan, struct vm_state *vms)
                if (vms->newmessages) {
                        res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
                        if (!res) {
-                               if ((vms->newmessages == 1)) {
+                               if (vms->newmessages == 1) {
                                        res = ast_play_and_wait(chan, "vm-message");
                                        if (!res)
                                                res = ast_play_and_wait(chan, "vm-INBOXs");
@@ -9727,7 +9727,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
                                res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
                        }
                        if (!res) {
-                               if ((vms->newmessages == 1))
+                               if (vms->newmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-novou");
                                if ((vms->newmessages) > 1 && (vms->newmessages < 5))
                                        res = ast_play_and_wait(chan, "vm-nove");
@@ -9737,7 +9737,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
                        if (vms->oldmessages && !res)
                                res = ast_play_and_wait(chan, "vm-and");
                        else if (!res) {
-                               if ((vms->newmessages == 1))
+                               if (vms->newmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-zpravu");
                                if ((vms->newmessages) > 1 && (vms->newmessages < 5))
                                        res = ast_play_and_wait(chan, "vm-zpravy");
@@ -9748,7 +9748,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
                if (!res && vms->oldmessages) {
                        res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
                        if (!res) {
-                               if ((vms->oldmessages == 1))
+                               if (vms->oldmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-starou");
                                if ((vms->oldmessages) > 1 && (vms->oldmessages < 5))
                                        res = ast_play_and_wait(chan, "vm-stare");
@@ -9756,7 +9756,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
                                        res = ast_play_and_wait(chan, "vm-starych");
                        }
                        if (!res) {
-                               if ((vms->oldmessages == 1))
+                               if (vms->oldmessages == 1)
                                        res = ast_play_and_wait(chan, "vm-zpravu");
                                if ((vms->oldmessages) > 1 && (vms->oldmessages < 5))
                                        res = ast_play_and_wait(chan, "vm-zpravy");
index 0d640755ad96100944a4c62e21e72708dbb4f3f4..6ac350caaf8448352e30206e141df5ee798240da 100644 (file)
@@ -4302,7 +4302,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                                        ast_channel_name(chan), ast_getformatname(&f->subclass.format), ast_getformatname_multiple(to, sizeof(to), ast_channel_nativeformats(chan)));
                                ast_frfree(f);
                                f = &ast_null_frame;
-                       } else if ((f->frametype == AST_FRAME_VOICE)) {
+                       } else if (f->frametype == AST_FRAME_VOICE) {
                                /* Send frame to audiohooks if present */
                                if (ast_channel_audiohooks(chan)) {
                                        struct ast_frame *old_frame = f;
index 9a6424ff49f8c0f71332d59a754c7c62144bef70..a219b7199e14c5bf2ff05c8d25e3b08a400122c9 100644 (file)
@@ -33,6 +33,9 @@ ael/ael_lex.o: _ASTCFLAGS+=-I. -Iael -Wno-unused
 
 ael/ael.tab.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
 ael/ael.tab.o: _ASTCFLAGS+=-I. -Iael -DYYENABLE_NLS=0
+       ifneq ($(AST_CLANG_BLOCKS),)
+               _ASTCFLAGS+=-Wno-parentheses-equality
+       endif
 
 $(if $(filter res_ais,$(EMBEDDED_MODS)),modules.link,res_ais.so): ais/clm.o ais/evt.o
 ais/clm.o ais/evt.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ais)
index bca2d4efca24f4043be5bb1bf27bc33425936686..2c841fd429580753d583e1d7a3359500c6240127 100644 (file)
@@ -138,6 +138,9 @@ aelbison.c: $(ASTTOPDIR)/res/ael/ael.tab.c
        $(ECHO_PREFIX) echo "   [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
        $(CMD_PREFIX) cp "$<" "$@"
 aelbison.o: _ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0
+       ifneq ($(AST_CLANG_BLOCKS),)
+               _ASTCFLAGS+=-Wno-parentheses-equality
+       endif
 
 pbx_ael.c: $(ASTTOPDIR)/pbx/pbx_ael.c
        $(ECHO_PREFIX) echo "   [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"