summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-06 05:28:12 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-06 05:28:12 +0200
commitd25c5a3901290903663d3eb7fd59ef930a3ece17 (patch)
tree99b910d67823f444c58e0ef889bd310274aa09d7
parent6d72913849ea278f7ea0e95c5c635967fbb472f3 (diff)
downloadokeffa-d25c5a3901290903663d3eb7fd59ef930a3ece17.tar.gz
fuks
-rw-r--r--calc/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/calc/main.c b/calc/main.c
index af25e9e..897363c 100644
--- a/calc/main.c
+++ b/calc/main.c
@@ -40,6 +40,18 @@ static void e(char const *str){
eggog("pos: %zu: %s",pos,str);
}
+static void push(void){
+ if(++sp >= sh) e("stack overflow");
+}
+
+static void drop(void){
+ fz_clear(&STACK(sp--),fl);
+}
+
+static void want(size_t n){
+ if(sp < n) e("stack underflow");
+}
+
int main(int argc,char **argv){
if(argc != 3){
eggog("usage: ffa_calc bitness stack_height");