Let's introduce a special stackpointer_t type to represent a type of a stack pointer.
Also set STACK_SZ to UINT8_MAX + 1.
This commit is contained in:
parent
57941c07ec
commit
96a6593672
@ -6,7 +6,8 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|
||||||
#define STACK_SZ 256
|
#define STACK_SZ UINT8_MAX+1
|
||||||
|
typedef uint8_t stackpointer_t;
|
||||||
|
|
||||||
int32_t parse_number(char *end);
|
int32_t parse_number(char *end);
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ int main(int argc, char **argv) {
|
|||||||
char *colon_pos = NULL, *pipe_pos = NULL;
|
char *colon_pos = NULL, *pipe_pos = NULL;
|
||||||
|
|
||||||
uint64_t stack[STACK_SZ] = {0};
|
uint64_t stack[STACK_SZ] = {0};
|
||||||
uint8_t stack_pos = 0;
|
stackpointer_t stack_pos = 0;
|
||||||
|
|
||||||
while (getline(&line, &line_length, input) != -1) {
|
while (getline(&line, &line_length, input) != -1) {
|
||||||
colon_pos = strchr(line, ':');
|
colon_pos = strchr(line, ':');
|
||||||
|
Loading…
Reference in New Issue
Block a user