mcf's improved rsval()

It is semantically the same but
does not rely on implementation-
defined behavior.
This commit is contained in:
Quentin Carbonneaux 2024-04-07 22:09:32 +02:00
parent dc3f7d7c4a
commit a2ad38086c

2
all.h
View file

@ -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 {