From 4a7a152105be6513a096f6a502b6eabe4d9befc3 Mon Sep 17 00:00:00 2001 From: Laurent Fasnacht Date: Mon, 10 Feb 2020 10:17:28 +0000 Subject: scanner: remove parser_state->indesc_idx Now that we have a proper stack implementation, we don't need an additional counter for the number of buffer state pushed. Signed-off-by: Laurent Fasnacht Signed-off-by: Pablo Neira Ayuso --- include/parser.h | 1 - src/scanner.l | 6 ------ 2 files changed, 7 deletions(-) diff --git a/include/parser.h b/include/parser.h index 66db92d8..636d1c88 100644 --- a/include/parser.h +++ b/include/parser.h @@ -15,7 +15,6 @@ struct parser_state { struct input_descriptor *indesc; - unsigned int indesc_idx; struct list_head indesc_list; struct list_head *msgs; diff --git a/src/scanner.l b/src/scanner.l index 9e19577d..ed29833b 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -674,12 +674,10 @@ static void scanner_push_indesc(struct parser_state *state, list_add(&indesc->list, &state->indesc->list); state->indesc = indesc; - state->indesc_idx++; } static void scanner_pop_indesc(struct parser_state *state) { - state->indesc_idx--; if (!list_empty(&state->indesc_list)) { state->indesc = list_entry(state->indesc->list.prev, struct input_descriptor, list); @@ -969,10 +967,6 @@ void scanner_destroy(struct nft_ctx *nft) { struct parser_state *state = yyget_extra(nft->scanner); - do { - yypop_buffer_state(nft->scanner); - } while (state->indesc_idx--); - input_descriptor_list_destroy(state); yylex_destroy(nft->scanner); } -- cgit v1.2.3