]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: remove last_line from struct location
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 12 Dec 2024 23:04:40 +0000 (00:04 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 2 Jan 2025 18:58:11 +0000 (19:58 +0100)
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@netfilter.org>
include/nftables.h
src/parser_bison.y
src/parser_json.c
src/scanner.l

index 7d891b439a2defea926d7b49eeeeed66bf811009..a6f0e6128887db8060d393a6dfe9f7230e774644 100644 (file)
@@ -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;
                };
index 6e8b639104fcb112c8d04b6589a00d2ee388e193..e107ddfd3e4e226b93fac791c5f8c5167f08b24a 100644 (file)
@@ -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;
        }
 }
index 5ac5f0270d325cc4f88c5616b154c323210fed36..17bc38b565aee5cbec3caee3480ddad6c718c216 100644 (file)
@@ -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,
index ecdba404b2cd8f7a526bf9271bc709f2461bc41d..4a340b00fdc66d29cfe5c325add2d20a9e982009 100644 (file)
@@ -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;