]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp.c: Remove a dead store.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 20 May 2025 20:13:54 +0000 (22:13 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 22 May 2025 14:44:07 +0000 (16:44 +0200)
Found by the clang analyzer.

mp.c

diff --git a/mp.c b/mp.c
index 94719e5632045e2b75c002786bfef852e8ef4105..de307587292d6d6ed193cc6ba717f462eaf5c17b 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -506,7 +506,6 @@ void mp_yyset_lineno(int lineno, mp_yyscan_t scanner);
 int mp_init(const char *definition, int nbytes, struct mp_context **result,
                 char **errmsg)
 {
-       int ret;
        mp_yyscan_t scanner;
        struct mp_context *ctx;
        struct yy_buffer_state *buffer_state;
@@ -521,12 +520,11 @@ int mp_init(const char *definition, int nbytes, struct mp_context **result,
        ctx->errmsg = NULL;
        ctx->ast = NULL;
 
-       ret = mp_yylex_init(&scanner);
-       assert(ret == 0);
+       assert(mp_yylex_init(&scanner) == 0);
        buffer_state = mp_yy_scan_bytes(definition, nbytes, scanner);
        mp_yyset_lineno(1, scanner);
        PARA_NOTICE_LOG("creating abstract syntax tree\n");
-       ret = mp_yyparse(ctx, &ctx->ast, scanner);
+       mp_yyparse(ctx, &ctx->ast, scanner);
        mp_yy_delete_buffer(buffer_state, scanner);
        mp_yylex_destroy(scanner);
        if (ctx->errmsg) { /* parse error */