harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c11d64bd42df5177ac0d79865acb139ff23fe2ea
parent c4ee127494e743009411191808690734ebe4e0e7
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Tue,  9 Feb 2021 13:27:59 -0500

lex: remove unused variable

Negation is handled by strto{umax,imax,d}

Diffstat:
Msrc/lex.c | 10----------
1 file changed, 0 insertions(+), 10 deletions(-)

diff --git a/src/lex.c b/src/lex.c @@ -266,7 +266,6 @@ lex_name(struct lexer *lexer, struct token *out) static uint32_t lex_literal(struct lexer *lexer, struct token *out) { - bool neg = false; uint32_t c = next(lexer, &out->loc, true); if (c == '-') { c = next(lexer, NULL, true); @@ -404,9 +403,6 @@ finalize: for (uintmax_t i = 0; i < exponent; i++) { out->uval *= 10; } - if (neg) { - out->uval = -out->uval; - } break; case TYPE_STORAGE_I8: case TYPE_STORAGE_I16: @@ -417,16 +413,10 @@ finalize: for (uintmax_t i = 0; i < exponent; i++) { out->ival *= 10; } - if (neg) { - out->ival = -out->ival; - } break; case TYPE_STORAGE_F32: case TYPE_STORAGE_F64: out->fval = strtod(lexer->buf, NULL); - if (neg) { - out->fval = -out->fval; - } break; default: assert(0);