aboutsummaryrefslogtreecommitdiff
path: root/all.h
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2024-04-07 22:09:32 +0200
committerQuentin Carbonneaux <[email protected]>2024-04-07 22:18:01 +0200
commita2ad38086c565419da9ebf4055d83f34489e521d (patch)
tree6975d4eca7a3bcfd828df2a889344514ee878d86 /all.h
parentdc3f7d7c4a7a5c74f2de1c1de051057050066393 (diff)
mcf's improved rsval()
It is semantically the same but does not rely on implementation- defined behavior.
Diffstat (limited to 'all.h')
-rw-r--r--all.h2
1 files changed, 1 insertions, 1 deletions
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 {