simgear/nasal/codegen.c: avoid compiler warning in findConstantIndex().

This commit is contained in:
Julian Smith
2021-10-31 08:24:38 +00:00
parent 5ce5044dce
commit ddea2de3a0

View File

@@ -88,7 +88,12 @@ static int findConstantIndex(struct Parser* p, struct Token* t)
if(t->type == TOK_SYMBOL) c = naInternSymbol(c);
} else if(t->type == TOK_FUNC) c = newLambda(p, t);
else if(t->type == TOK_LITERAL) c = naNum(t->num);
else naParseError(p, "invalid/non-constant constant", t->line);
else {
naParseError(p, "invalid/non-constant constant", t->line);
/* naParseError() doesn't return, but this stops compiler complaining
about <c> not being set. */
return -1;
}
return internConstant(p, c);
}