diff options
author | Quentin Carbonneaux <quentin@c9x.me> | 2022-12-12 17:36:15 +0100 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2022-12-12 22:16:33 +0100 |
commit | c0f25aeae3ef5d5f4b6bc5678f8d8ce40597d673 (patch) | |
tree | 26b78f6db8a8fd46005ce94835b0135a6df4eef7 /all.h | |
parent | 2ec355df6adc457303fcf2076b559fefd80ee593 (diff) | |
download | roux-c0f25aeae3ef5d5f4b6bc5678f8d8ce40597d673.tar.gz |
new rsval() helper for signed Refs
The .val field is signed in RSlot. Add a new dedicated function to fetch it as a signed int.
Diffstat (limited to 'all.h')
-rw-r--r-- | all.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/all.h b/all.h index 3ddb944..fe2b56b 100644 --- a/all.h +++ b/all.h @@ -110,6 +110,11 @@ static inline int rtype(Ref r) return r.type; } +static inline int rsval(Ref r) +{ + return ((int32_t)r.val << 3) >> 3; +} + enum CmpI { Cieq, Cine, |