[PATCH nft 1/2] src: remove last_line from struct location

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This 4 bytes field is never used, remove it.

This does not shrink struct location in x86_64 due to alignment.

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 include/nftables.h | 1 -
 src/parser_bison.y | 3 +--
 src/parser_json.c  | 1 -
 src/scanner.l      | 1 -
 4 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/include/nftables.h b/include/nftables.h
index 7d891b439a2d..a6f0e6128887 100644
--- a/include/nftables.h
+++ b/include/nftables.h
@@ -161,7 +161,6 @@ struct location {
 			off_t			line_offset;
 
 			unsigned int		first_line;
-			unsigned int		last_line;
 			unsigned int		first_column;
 			unsigned int		last_column;
 		};
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 6e8b639104fc..e107ddfd3e4e 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -105,12 +105,11 @@ static void location_update(struct location *loc, struct location *rhs, int n)
 		loc->line_offset  = rhs[1].line_offset;
 		loc->first_line   = rhs[1].first_line;
 		loc->first_column = rhs[1].first_column;
-		loc->last_line    = rhs[n].last_line;
 		loc->last_column  = rhs[n].last_column;
 	} else {
 		loc->indesc       = rhs[0].indesc;
 		loc->line_offset  = rhs[0].line_offset;
-		loc->first_line   = loc->last_line   = rhs[0].last_line;
+		loc->first_line   = rhs[0].first_line;
 		loc->first_column = loc->last_column = rhs[0].last_column;
 	}
 }
diff --git a/src/parser_json.c b/src/parser_json.c
index 5ac5f0270d32..17bc38b565ae 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -123,7 +123,6 @@ static void json_lib_error(struct json_ctx *ctx, json_error_t *err)
 		.indesc = &json_indesc,
 		.line_offset = err->position - err->column,
 		.first_line = err->line,
-		.last_line = err->line,
 		.first_column = err->column,
 		/* no information where problematic part ends :( */
 		.last_column = err->column,
diff --git a/src/scanner.l b/src/scanner.l
index ecdba404b2cd..4a340b00fdc6 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -80,7 +80,6 @@ static void update_pos(struct parser_state *state, struct location *loc,
 {
 	loc->indesc			= state->indesc;
 	loc->first_line			= state->indesc->lineno;
-	loc->last_line			= state->indesc->lineno;
 	loc->first_column		= state->indesc->column;
 	loc->last_column		= state->indesc->column + len - 1;
 	state->indesc->column		+= len;
-- 
2.30.2





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux