BUILD/CLEANUP: config: silent 3 warnings about mixed declarations with code

These ones were present in the tcp-check parser.
This commit is contained in:
Willy Tarreau 2015-02-27 16:37:05 +01:00
parent 622317d5e2
commit e7acee70a3

View File

@ -4798,14 +4798,15 @@ stats_error_parsing:
* exclamation mark, and cur_arg is the argument which holds this word. * exclamation mark, and cur_arg is the argument which holds this word.
*/ */
if (strcmp(ptr_arg, "binary") == 0) { if (strcmp(ptr_arg, "binary") == 0) {
struct tcpcheck_rule *tcpcheck;
char *err = NULL;
if (!*(args[cur_arg + 1])) { if (!*(args[cur_arg + 1])) {
Alert("parsing [%s:%d] : '%s %s %s' expects <binary string> as an argument.\n", Alert("parsing [%s:%d] : '%s %s %s' expects <binary string> as an argument.\n",
file, linenum, args[0], args[1], ptr_arg); file, linenum, args[0], args[1], ptr_arg);
err_code |= ERR_ALERT | ERR_FATAL; err_code |= ERR_ALERT | ERR_FATAL;
goto out; goto out;
} }
struct tcpcheck_rule *tcpcheck;
char *err = NULL;
tcpcheck = (struct tcpcheck_rule *)calloc(1, sizeof(*tcpcheck)); tcpcheck = (struct tcpcheck_rule *)calloc(1, sizeof(*tcpcheck));
@ -4822,13 +4823,14 @@ stats_error_parsing:
LIST_ADDQ(&curproxy->tcpcheck_rules, &tcpcheck->list); LIST_ADDQ(&curproxy->tcpcheck_rules, &tcpcheck->list);
} }
else if (strcmp(ptr_arg, "string") == 0) { else if (strcmp(ptr_arg, "string") == 0) {
struct tcpcheck_rule *tcpcheck;
if (!*(args[cur_arg + 1])) { if (!*(args[cur_arg + 1])) {
Alert("parsing [%s:%d] : '%s %s %s' expects <string> as an argument.\n", Alert("parsing [%s:%d] : '%s %s %s' expects <string> as an argument.\n",
file, linenum, args[0], args[1], ptr_arg); file, linenum, args[0], args[1], ptr_arg);
err_code |= ERR_ALERT | ERR_FATAL; err_code |= ERR_ALERT | ERR_FATAL;
goto out; goto out;
} }
struct tcpcheck_rule *tcpcheck;
tcpcheck = (struct tcpcheck_rule *)calloc(1, sizeof(*tcpcheck)); tcpcheck = (struct tcpcheck_rule *)calloc(1, sizeof(*tcpcheck));
@ -4841,13 +4843,14 @@ stats_error_parsing:
LIST_ADDQ(&curproxy->tcpcheck_rules, &tcpcheck->list); LIST_ADDQ(&curproxy->tcpcheck_rules, &tcpcheck->list);
} }
else if (strcmp(ptr_arg, "rstring") == 0) { else if (strcmp(ptr_arg, "rstring") == 0) {
struct tcpcheck_rule *tcpcheck;
if (!*(args[cur_arg + 1])) { if (!*(args[cur_arg + 1])) {
Alert("parsing [%s:%d] : '%s %s %s' expects <regex> as an argument.\n", Alert("parsing [%s:%d] : '%s %s %s' expects <regex> as an argument.\n",
file, linenum, args[0], args[1], ptr_arg); file, linenum, args[0], args[1], ptr_arg);
err_code |= ERR_ALERT | ERR_FATAL; err_code |= ERR_ALERT | ERR_FATAL;
goto out; goto out;
} }
struct tcpcheck_rule *tcpcheck;
tcpcheck = (struct tcpcheck_rule *)calloc(1, sizeof(*tcpcheck)); tcpcheck = (struct tcpcheck_rule *)calloc(1, sizeof(*tcpcheck));