commit 0ea030fae1738d6513e28f719f91b505ff0b64be from: Omar Polo date: Sat Mar 19 14:09:06 2022 UTC constify v_{true,false} and pushv commit - 4226d2c7de9db8eccd22c5245a95829f00815f0c commit + 0ea030fae1738d6513e28f719f91b505ff0b64be blob - 9d142fc4005b1efccd2fe162a18f5c570cbf394c blob + a752840baf284612fef5d9bdaeb044f41bc27366 --- ninepscript/script.c +++ ninepscript/script.c @@ -74,8 +74,8 @@ static int stackh; static struct envs envs = TAILQ_HEAD_INITIALIZER(envs); -static struct value v_false = {.type = V_NUM, .v = {.num = 0}}; -static struct value v_true = {.type = V_NUM, .v = {.num = 1}}; +static const struct value v_false = {.type = V_NUM, .v = {.num = 0}}; +static const struct value v_true = {.type = V_NUM, .v = {.num = 1}}; static uint8_t lasttag; @@ -156,7 +156,7 @@ popvn(int n) } static inline void -pushv(struct value *v) +pushv(const struct value *v) { if (stackh == STACK_HEIGHT) errx(1, "can't push the stack: overflow");