diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-01-01 14:23:34 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-01-01 14:23:34 +0100 |
commit | 8a3ed3c5996e8a88d94c24daa091dcd11fd81fac (patch) | |
tree | d9ac6b421e70de7ebda0697e3faf3f73c9e3c07c /api/int.c | |
parent | 53990e718867f7bf0cd49a1962e9695164a17eb2 (diff) | |
download | uwu-lang-8a3ed3c5996e8a88d94c24daa091dcd11fd81fac.tar.xz |
uwuint: use long instead of int to prevent YEAR2038 problem in nolambda time library
Diffstat (limited to 'api/int.c')
-rw-r--r-- | api/int.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -2,32 +2,32 @@ #include "common/str.h" #include "int.h" -UwUVMValue uwuint_create(int value) +UwUVMValue uwuint_create(long value) { UwUVMValue vm_value = { .type = &uwuint_type, - .data = malloc(sizeof(int)) + .data = malloc(sizeof(long)) }; - *(int *) vm_value.data = value; + *(long *) vm_value.data = value; return vm_value; } int uwuint_get(UwUVMValue vm_value) { - return *(int *) vm_value.data; + return *(long *) vm_value.data; } void *uwuint_clone(void *data) { - int *copy = malloc(sizeof(*copy)); - *copy = *(int *) data; + long *copy = malloc(sizeof(*copy)); + *copy = *(long *) data; return copy; } char *uwuint_print(void *data) { - return asprintf_wrapper("%d", *(int *) data); + return asprintf_wrapper("%l", *(long *) data); } UwUVMType uwuint_type = { |