summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-06 03:08:52 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-06 03:10:02 +0200
commit6c4db939da11ec68d5be5ad77979846a42a04635 (patch)
tree64ee24788a9ea7e08eb3873471532de1c878781e
parentcbbeb1d7f8b53f396fc1b3b57a54e006e16cd489 (diff)
downloadokeffa-6c4db939da11ec68d5be5ad77979846a42a04635.tar.gz
brianded
-rw-r--r--calc/main.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/calc/main.c b/calc/main.c
index 814f8f0..3359d35 100644
--- a/calc/main.c
+++ b/calc/main.c
@@ -11,9 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
-#define WIDTH_MAX 1024
-#define HEIGHT_MAX 64
-#define STACK_SIZE (WIDTH_MAX/WORD_BITNESS*HEIGHT_MAX)
+#define STACK_SIZE 65536
#define _STR(X) #X
#define STR(X) _STR(X)
@@ -41,12 +39,8 @@ int main(int argc,char **argv){
eggog("invalid width: "FZ_VALIDITY_RULE_DOC);
}
- if(width > WIDTH_MAX){
- eggog("max width: "STR(WIDTH_MAX));
- }
-
- if(height > HEIGHT_MAX){
- eggog("max height: "STR(HEIGHT_MAX));
+ if(width/IRON_BYTEBITS*height > STACK_SIZE){
+ eggog("max stack size: "STR(STACK_SIZE));
}
wordness = width/WORD_BITNESS;