فهرست منبع

mcf's improved rsval()

It is semantically the same but
does not rely on implementation-
defined behavior.
Quentin Carbonneaux 1 سال پیش
والد
کامیت
a2ad38086c
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      all.h

+ 1 - 1
all.h

@@ -115,7 +115,7 @@ static inline int rtype(Ref r)
 
 
 static inline int rsval(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 {
 enum CmpI {