blueloveTH 1 год назад
Родитель
Сommit
3aea1647d0
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      include/pocketpy/common.h
  2. 2 2
      src/ceval.cpp

+ 1 - 1
include/pocketpy/common.h

@@ -180,7 +180,7 @@ struct Type {
 #define PK_ASSERT(x) if(!(x)) PK_FATAL_ERROR();
 
 struct PyObject;
-#define PK_BITS(p) (reinterpret_cast<Number::int_t>(p))
+#define PK_BITS(p) (reinterpret_cast<i64>(p))
 #define PK_SMALL_INT(val) (reinterpret_cast<PyObject*>(val << 2 | 0b10))
 
 inline PyObject* tag_float(f64 val){

+ 2 - 2
src/ceval.cpp

@@ -4,14 +4,14 @@ namespace pkpy{
 
 #define PREDICT_INT_OP(op)  \
     if(is_small_int(_0) && is_small_int(_1)){   \
-        TOP() = VAR((i64)(PK_BITS(_0)>>2) op (i64)(PK_BITS(_1)>>2)); \
+        TOP() = VAR((PK_BITS(_0)>>2) op (PK_BITS(_1)>>2)); \
         DISPATCH() \
     }
 
 #define PREDICT_INT_DIV_OP(op)  \
     if(is_small_int(_0) && is_small_int(_1)){   \
         if(_1 == PK_SMALL_INT(0)) ZeroDivisionError();   \
-        TOP() = VAR((i64)(PK_BITS(_0)>>2) op (i64)(PK_BITS(_1)>>2)); \
+        TOP() = VAR((PK_BITS(_0)>>2) op (PK_BITS(_1)>>2)); \
         DISPATCH() \
     }