aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-03-23 23:37:25 +0800
committerMistivia <i@mistivia.com>2025-03-23 23:37:25 +0800
commit4f7f0aa49844756dbf430f35600d7c88e1a6a730 (patch)
tree7b3fcc235f33ebec5c7623b6cc3946a138162682 /src/main.c
parent45e53e55aa555d5a53d9d489e8447e9112eac1f0 (diff)
refactor names
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 7740d52..a018cef 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,11 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
+#include <inttypes.h>
#include "fvm.h"
-static void printnum(struct fvm *vm) {
+static void print_num(struct fvm *vm) {
int64_t n = fvm_pop(vm);
- printf("%lld\n", n);
+ printf("%" PRId64 "\n", n);
}
int main(int argc, char **argv) {
@@ -15,7 +16,7 @@ int main(int argc, char **argv) {
return -1;
}
vm.syscall_table = malloc(256 * sizeof(fvm_syscall_fn_t));
- vm.syscall_table[1] = &printnum;
+ vm.syscall_table[1] = &print_num;
FILE* fp = fopen(argv[1], "rb");
if (fp == NULL) {
fprintf(stderr, "Failed to open file.\n");