blueloveTH hace 2 años
padre
commit
3aea1647d0
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  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();
 #define PK_ASSERT(x) if(!(x)) PK_FATAL_ERROR();
 
 
 struct PyObject;
 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))
 #define PK_SMALL_INT(val) (reinterpret_cast<PyObject*>(val << 2 | 0b10))
 
 
 inline PyObject* tag_float(f64 val){
 inline PyObject* tag_float(f64 val){

+ 2 - 2
src/ceval.cpp

@@ -4,14 +4,14 @@ namespace pkpy{
 
 
 #define PREDICT_INT_OP(op)  \
 #define PREDICT_INT_OP(op)  \
     if(is_small_int(_0) && is_small_int(_1)){   \
     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() \
         DISPATCH() \
     }
     }
 
 
 #define PREDICT_INT_DIV_OP(op)  \
 #define PREDICT_INT_DIV_OP(op)  \
     if(is_small_int(_0) && is_small_int(_1)){   \
     if(is_small_int(_0) && is_small_int(_1)){   \
         if(_1 == PK_SMALL_INT(0)) ZeroDivisionError();   \
         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() \
         DISPATCH() \
     }
     }