Changeset View
Changeset View
Standalone View
Standalone View
head/bin/sh/arith_yacc.c
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | static arith_t arith_lookupvarint(char *varname) | ||||
arith_t result; | arith_t result; | ||||
str = lookupvar(varname); | str = lookupvar(varname); | ||||
if (uflag && str == NULL) | if (uflag && str == NULL) | ||||
yyerror("variable not set"); | yyerror("variable not set"); | ||||
if (str == NULL || *str == '\0') | if (str == NULL || *str == '\0') | ||||
str = "0"; | str = "0"; | ||||
errno = 0; | errno = 0; | ||||
result = strtoarith_t(str, &p, 0); | result = strtoarith_t(str, &p); | ||||
if (errno != 0 || *p != '\0') | if (errno != 0 || *p != '\0') | ||||
yyerror("variable conversion error"); | yyerror("variable conversion error"); | ||||
return result; | return result; | ||||
} | } | ||||
static inline int arith_prec(int op) | static inline int arith_prec(int op) | ||||
{ | { | ||||
return prec[op - ARITH_BINOP_MIN]; | return prec[op - ARITH_BINOP_MIN]; | ||||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |