mirror of
https://github.com/asterisk/asterisk.git
synced 2026-06-18 13:34:16 +00:00
clang compiler warnings: Fix -Wparantheses-equality warnings
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) ........ Merged revisions 433687 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433688 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
+1
-1
@@ -175,7 +175,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data)
|
|||||||
ast_queue_frame(chan, &fr);
|
ast_queue_frame(chan, &fr);
|
||||||
digit = 0;
|
digit = 0;
|
||||||
}
|
}
|
||||||
if ((f->frametype == AST_FRAME_DTMF)) {
|
if (f->frametype == AST_FRAME_DTMF) {
|
||||||
int got = 1;
|
int got = 1;
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case DMODE_PLAY:
|
case DMODE_PLAY:
|
||||||
|
|||||||
+17
-17
@@ -9099,7 +9099,7 @@ static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (!res)
|
if (!res)
|
||||||
res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
|
res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if ((vms->newmessages == 1)) {
|
if (vms->newmessages == 1) {
|
||||||
res = ast_play_and_wait(chan, "vm-INBOX");
|
res = ast_play_and_wait(chan, "vm-INBOX");
|
||||||
if (!res)
|
if (!res)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
@@ -9113,7 +9113,7 @@ static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
res = ast_play_and_wait(chan, "vm-youhave");
|
res = ast_play_and_wait(chan, "vm-youhave");
|
||||||
if (!res)
|
if (!res)
|
||||||
res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
|
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");
|
res = ast_play_and_wait(chan, "vm-Old");
|
||||||
if (!res)
|
if (!res)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
@@ -9344,7 +9344,7 @@ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if ((vms->oldmessages || vms->newmessages) && !res) {
|
if ((vms->oldmessages || vms->newmessages) && !res) {
|
||||||
res = ast_play_and_wait(chan, "vm-and");
|
res = ast_play_and_wait(chan, "vm-and");
|
||||||
} else if (!res) {
|
} else if (!res) {
|
||||||
if ((vms->urgentmessages == 1))
|
if (vms->urgentmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
else
|
else
|
||||||
res = ast_play_and_wait(chan, "vm-messages");
|
res = ast_play_and_wait(chan, "vm-messages");
|
||||||
@@ -9357,7 +9357,7 @@ static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (vms->oldmessages && !res)
|
if (vms->oldmessages && !res)
|
||||||
res = ast_play_and_wait(chan, "vm-and");
|
res = ast_play_and_wait(chan, "vm-and");
|
||||||
else if (!res) {
|
else if (!res) {
|
||||||
if ((vms->newmessages == 1))
|
if (vms->newmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
else
|
else
|
||||||
res = ast_play_and_wait(chan, "vm-messages");
|
res = ast_play_and_wait(chan, "vm-messages");
|
||||||
@@ -9509,7 +9509,7 @@ static int vm_intro_se(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (vms->newmessages) {
|
if (vms->newmessages) {
|
||||||
if ((vms->newmessages == 1)) {
|
if (vms->newmessages == 1) {
|
||||||
res = ast_play_and_wait(chan, "digits/ett");
|
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-nytt");
|
||||||
res = res ? res : ast_play_and_wait(chan, "vm-message");
|
res = res ? res : ast_play_and_wait(chan, "vm-message");
|
||||||
@@ -9553,7 +9553,7 @@ static int vm_intro_no(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (vms->newmessages) {
|
if (vms->newmessages) {
|
||||||
if ((vms->newmessages == 1)) {
|
if (vms->newmessages == 1) {
|
||||||
res = ast_play_and_wait(chan, "digits/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-ny");
|
||||||
res = res ? res : ast_play_and_wait(chan, "vm-message");
|
res = res ? res : ast_play_and_wait(chan, "vm-message");
|
||||||
@@ -9588,7 +9588,7 @@ static int vm_intro_de(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
res = ast_play_and_wait(chan, "vm-youhave");
|
res = ast_play_and_wait(chan, "vm-youhave");
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if (vms->newmessages) {
|
if (vms->newmessages) {
|
||||||
if ((vms->newmessages == 1))
|
if (vms->newmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "digits/1F");
|
res = ast_play_and_wait(chan, "digits/1F");
|
||||||
else
|
else
|
||||||
res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
|
res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
|
||||||
@@ -9597,7 +9597,7 @@ static int vm_intro_de(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (vms->oldmessages && !res)
|
if (vms->oldmessages && !res)
|
||||||
res = ast_play_and_wait(chan, "vm-and");
|
res = ast_play_and_wait(chan, "vm-and");
|
||||||
else if (!res) {
|
else if (!res) {
|
||||||
if ((vms->newmessages == 1))
|
if (vms->newmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
else
|
else
|
||||||
res = ast_play_and_wait(chan, "vm-messages");
|
res = ast_play_and_wait(chan, "vm-messages");
|
||||||
@@ -9644,7 +9644,7 @@ static int vm_intro_es(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (!res) {
|
if (!res) {
|
||||||
if (vms->newmessages) {
|
if (vms->newmessages) {
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if ((vms->newmessages == 1)) {
|
if (vms->newmessages == 1) {
|
||||||
res = ast_play_and_wait(chan, "digits/1M");
|
res = ast_play_and_wait(chan, "digits/1M");
|
||||||
if (!res)
|
if (!res)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
@@ -9695,7 +9695,7 @@ static int vm_intro_pt_BR(struct ast_channel *chan, struct vm_state *vms) {
|
|||||||
if (vms->newmessages) {
|
if (vms->newmessages) {
|
||||||
if (!res)
|
if (!res)
|
||||||
res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
|
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)
|
if (!res)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
if (!res)
|
if (!res)
|
||||||
@@ -9741,7 +9741,7 @@ static int vm_intro_fr(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (vms->oldmessages && !res)
|
if (vms->oldmessages && !res)
|
||||||
res = ast_play_and_wait(chan, "vm-and");
|
res = ast_play_and_wait(chan, "vm-and");
|
||||||
else if (!res) {
|
else if (!res) {
|
||||||
if ((vms->newmessages == 1))
|
if (vms->newmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
else
|
else
|
||||||
res = ast_play_and_wait(chan, "vm-messages");
|
res = ast_play_and_wait(chan, "vm-messages");
|
||||||
@@ -9788,7 +9788,7 @@ static int vm_intro_nl(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (vms->oldmessages && !res)
|
if (vms->oldmessages && !res)
|
||||||
res = ast_play_and_wait(chan, "vm-and");
|
res = ast_play_and_wait(chan, "vm-and");
|
||||||
else if (!res) {
|
else if (!res) {
|
||||||
if ((vms->newmessages == 1))
|
if (vms->newmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
else
|
else
|
||||||
res = ast_play_and_wait(chan, "vm-messages");
|
res = ast_play_and_wait(chan, "vm-messages");
|
||||||
@@ -9831,7 +9831,7 @@ static int vm_intro_pt(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (vms->newmessages) {
|
if (vms->newmessages) {
|
||||||
res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
|
res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if ((vms->newmessages == 1)) {
|
if (vms->newmessages == 1) {
|
||||||
res = ast_play_and_wait(chan, "vm-message");
|
res = ast_play_and_wait(chan, "vm-message");
|
||||||
if (!res)
|
if (!res)
|
||||||
res = ast_play_and_wait(chan, "vm-INBOXs");
|
res = ast_play_and_wait(chan, "vm-INBOXs");
|
||||||
@@ -9897,7 +9897,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));
|
res = say_and_wait(chan, vms->newmessages, ast_channel_language(chan));
|
||||||
}
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if ((vms->newmessages == 1))
|
if (vms->newmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-novou");
|
res = ast_play_and_wait(chan, "vm-novou");
|
||||||
if ((vms->newmessages) > 1 && (vms->newmessages < 5))
|
if ((vms->newmessages) > 1 && (vms->newmessages < 5))
|
||||||
res = ast_play_and_wait(chan, "vm-nove");
|
res = ast_play_and_wait(chan, "vm-nove");
|
||||||
@@ -9907,7 +9907,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (vms->oldmessages && !res)
|
if (vms->oldmessages && !res)
|
||||||
res = ast_play_and_wait(chan, "vm-and");
|
res = ast_play_and_wait(chan, "vm-and");
|
||||||
else if (!res) {
|
else if (!res) {
|
||||||
if ((vms->newmessages == 1))
|
if (vms->newmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-zpravu");
|
res = ast_play_and_wait(chan, "vm-zpravu");
|
||||||
if ((vms->newmessages) > 1 && (vms->newmessages < 5))
|
if ((vms->newmessages) > 1 && (vms->newmessages < 5))
|
||||||
res = ast_play_and_wait(chan, "vm-zpravy");
|
res = ast_play_and_wait(chan, "vm-zpravy");
|
||||||
@@ -9918,7 +9918,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
if (!res && vms->oldmessages) {
|
if (!res && vms->oldmessages) {
|
||||||
res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
|
res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if ((vms->oldmessages == 1))
|
if (vms->oldmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-starou");
|
res = ast_play_and_wait(chan, "vm-starou");
|
||||||
if ((vms->oldmessages) > 1 && (vms->oldmessages < 5))
|
if ((vms->oldmessages) > 1 && (vms->oldmessages < 5))
|
||||||
res = ast_play_and_wait(chan, "vm-stare");
|
res = ast_play_and_wait(chan, "vm-stare");
|
||||||
@@ -9926,7 +9926,7 @@ static int vm_intro_cs(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
res = ast_play_and_wait(chan, "vm-starych");
|
res = ast_play_and_wait(chan, "vm-starych");
|
||||||
}
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if ((vms->oldmessages == 1))
|
if (vms->oldmessages == 1)
|
||||||
res = ast_play_and_wait(chan, "vm-zpravu");
|
res = ast_play_and_wait(chan, "vm-zpravu");
|
||||||
if ((vms->oldmessages) > 1 && (vms->oldmessages < 5))
|
if ((vms->oldmessages) > 1 && (vms->oldmessages < 5))
|
||||||
res = ast_play_and_wait(chan, "vm-zpravy");
|
res = ast_play_and_wait(chan, "vm-zpravy");
|
||||||
|
|||||||
+2
-2
@@ -4112,14 +4112,14 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
|
|||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
f = &ast_null_frame;
|
f = &ast_null_frame;
|
||||||
}
|
}
|
||||||
} else if ((f->frametype == AST_FRAME_VOICE) && ast_format_cap_iscompatible_format(ast_channel_nativeformats(chan), f->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
|
} else if (f->frametype == AST_FRAME_VOICE && ast_format_cap_iscompatible_format(ast_channel_nativeformats(chan), f->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
|
||||||
/* This frame is not one of the current native formats -- drop it on the floor */
|
/* This frame is not one of the current native formats -- drop it on the floor */
|
||||||
struct ast_str *codec_buf = ast_str_alloca(64);
|
struct ast_str *codec_buf = ast_str_alloca(64);
|
||||||
ast_log(LOG_NOTICE, "Dropping incompatible voice frame on %s of format %s since our native format has changed to %s\n",
|
ast_log(LOG_NOTICE, "Dropping incompatible voice frame on %s of format %s since our native format has changed to %s\n",
|
||||||
ast_channel_name(chan), ast_format_get_name(f->subclass.format), ast_format_cap_get_names(ast_channel_nativeformats(chan), &codec_buf));
|
ast_channel_name(chan), ast_format_get_name(f->subclass.format), ast_format_cap_get_names(ast_channel_nativeformats(chan), &codec_buf));
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
f = &ast_null_frame;
|
f = &ast_null_frame;
|
||||||
} else if ((f->frametype == AST_FRAME_VOICE)) {
|
} else if (f->frametype == AST_FRAME_VOICE) {
|
||||||
/* Send frame to audiohooks if present */
|
/* Send frame to audiohooks if present */
|
||||||
if (ast_channel_audiohooks(chan)) {
|
if (ast_channel_audiohooks(chan)) {
|
||||||
struct ast_frame *old_frame = f;
|
struct ast_frame *old_frame = f;
|
||||||
|
|||||||
@@ -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: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
|
||||||
ael/ael.tab.o: _ASTCFLAGS+=-I. -Iael -DYYENABLE_NLS=0
|
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
|
$(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)
|
ais/clm.o ais/evt.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ais)
|
||||||
|
|||||||
@@ -139,6 +139,9 @@ aelbison.c: $(ASTTOPDIR)/res/ael/ael.tab.c
|
|||||||
$(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
|
$(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
|
||||||
$(CMD_PREFIX) cp "$<" "$@"
|
$(CMD_PREFIX) cp "$<" "$@"
|
||||||
aelbison.o: _ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0
|
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
|
pbx_ael.c: $(ASTTOPDIR)/pbx/pbx_ael.c
|
||||||
$(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
|
$(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
|
||||||
|
|||||||
Reference in New Issue
Block a user