From a2ad38086c565419da9ebf4055d83f34489e521d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 7 Apr 2024 22:09:32 +0200 Subject: [PATCH] mcf's improved rsval() It is semantically the same but does not rely on implementation- defined behavior. --- all.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all.h b/all.h index 129dfbf..472980d 100644 --- a/all.h +++ b/all.h @@ -115,7 +115,7 @@ static inline int rtype(Ref r) static inline int rsval(Ref r) { - return (int32_t)((int64_t)r.val << 3) >> 3; + return ((int)r.val ^ 0x10000000) - 0x10000000; } enum CmpI {