From 7e37b1c58d28fc0fb2de5f6b29903bcdba8da250 Mon Sep 17 00:00:00 2001 From: Igmar Palsenberg Date: Mon, 6 Jun 2011 16:57:02 +0200 Subject: [PATCH 4/6] Dead code elimination --- src/regex/regcomp.c | 3 +-- src/regex/regexec.c | 4 ---- src/stdio/vfwprintf.c | 3 +-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 3307942..cb7e272 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -1845,13 +1845,12 @@ tre_add_tags(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree, case ADDTAGS_AFTER_ITERATION: { - int enter_tag; node = tre_stack_pop(stack); if (first_pass) node->num_tags = ((tre_iteration_t *)node->obj)->arg->num_tags + (int)tre_stack_pop(stack); else - enter_tag = (int)tre_stack_pop(stack); + (int)tre_stack_pop(stack); DPRINT(("After iteration\n")); direction = TRE_TAG_MAXIMIZE; diff --git a/src/regex/regexec.c b/src/regex/regexec.c index f7aef50..5aa52d9 100644 --- a/src/regex/regexec.c +++ b/src/regex/regexec.c @@ -180,7 +180,6 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len, int num_tags, i; int match_eo = -1; /* end offset of match (-1 if no match found yet) */ - int new_match = 0; int *tmp_tags = NULL; int *tmp_iptr; @@ -287,7 +286,6 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len, { DPRINT((" found empty match\n")); match_eo = pos; - new_match = 1; for (i = 0; i < num_tags; i++) match_tags[i] = reach_next_i->tags[i]; } @@ -387,7 +385,6 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len, { DPRINT((" found match %p\n", trans_i->state)); match_eo = pos; - new_match = 1; for (i = 0; i < num_tags; i++) match_tags[i] = reach_next_i->tags[i]; } @@ -411,7 +408,6 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len, { DPRINT((" found better match\n")); match_eo = pos; - new_match = 1; for (i = 0; i < num_tags; i++) match_tags[i] = tmp_tags[i]; } diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index 42ce304..064adb9 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -160,7 +160,7 @@ static const char sizeprefix['y'-'a'] = { static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_arg, int *nl_type) { - wchar_t *a, *z, *s=(wchar_t *)fmt, *s0; + wchar_t *a, *z, *s=(wchar_t *)fmt; unsigned l10n=0, litpct, fl; int w, p; union arg arg; @@ -235,7 +235,6 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ } else p = -1; /* Format specifier state machine */ - s0=s; st=0; do { if (OOB(*s)) return -1; -- 1.7.5.2