From c0f25aeae3ef5d5f4b6bc5678f8d8ce40597d673 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 12 Dec 2022 17:36:15 +0100 Subject: 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. --- all.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'all.h') 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, -- cgit v1.2.3