X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fobject.h;h=b62cacbd7793db78966e9cc86da31715d05b6491;hb=c25d7ca5386582feba3d02f69a7425ea5b868bc7;hp=80c886e3051108c8c47fe886eee00c00dcc5b966;hpb=6c1eef40f411ff4eec7a3f7599a81be7fae07e2a;p=muddle-interpreter.git diff --git a/src/object.h b/src/object.h index 80c886e..b62cacb 100644 --- a/src/object.h +++ b/src/object.h @@ -111,14 +111,14 @@ typedef struct alignas (16) evaltype type; pool_ptr rest; uint32_t _pad; - uint32_t val; + int32_t val; } fix32_object; typedef struct { alignas (16) evaltype type; pool_ptr rest; - uint64_t val; + int64_t val; } fix64_object; typedef struct @@ -196,12 +196,20 @@ union object Initialization helpers. */ +static inline fix32_object +new_fix32 (int32_t n) +{ + return (fix32_object) + { + .type = EVALTYPE_FIX32,.rest = 0,.val = n}; +} + static inline fix64_object -new_fix64 (uint64_t n) +new_fix64 (int64_t n) { return (fix64_object) { - .type = EVALTYPE_FIX64,.rest = 0,.val = n,}; + .type = EVALTYPE_FIX64,.rest = 0,.val = n}; } static inline list_object