From 475e73e27d92bb14fc2c8cf422967b3e62091d82 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Thu, 28 Jun 2007 19:05:59 +0000 Subject: [PATCH] Add -Wdeclaration-after-statement to AST_DEVMODE flags to catch variable declarations in the middle of a block. Fix the few instances of the above spotted out by the compiler. All of this has been already done or is not applicable in trunk, so the merge of this change will be blocked. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72462 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- Makefile | 2 +- channels/chan_zap.c | 3 ++- main/say.c | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d8ec7eb3b8..9e2e15837f 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declar ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h ifeq ($(AST_DEVMODE),yes) - ASTCFLAGS+=-Werror -Wunused + ASTCFLAGS+=-Werror -Wunused -Wdeclaration-after-statement endif ifneq ($(findstring BSD,$(OSARCH)),) diff --git a/channels/chan_zap.c b/channels/chan_zap.c index a69697cbc1..a6a77e72b7 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -10491,9 +10491,10 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r || !strcasecmp(v->name, "crv") #endif ) { + int iscrv; if (skipchannels) continue; - int iscrv = !strcasecmp(v->name, "crv"); + iscrv = !strcasecmp(v->name, "crv"); if (build_channels(*confp, iscrv, v->value, reload, v->lineno, &found_pseudo)) return -1; } else if (!strcasecmp(v->name, "zapchan")) { diff --git a/main/say.c b/main/say.c index 2c3937c761..d6106c035a 100644 --- a/main/say.c +++ b/main/say.c @@ -6729,6 +6729,9 @@ static int ast_say_number_full_ge(struct ast_channel *chan, int num, const char { int res = 0; char fn[512] = ""; + char* s = 0; + const char* remainder = fn; + if (!num) return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd); @@ -6736,8 +6739,6 @@ static int ast_say_number_full_ge(struct ast_channel *chan, int num, const char ast_translate_number_ge(num, fn, 512); - char* s = 0; - const char* remainder = fn; while (res == 0 && (s = strstr(remainder, " "))) { size_t len = s - remainder;