From 3aea1647d076def0157ffb092d0783feb712142d Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 17 Mar 2024 18:06:38 +0800 Subject: [PATCH] some fix --- include/pocketpy/common.h | 2 +- src/ceval.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/pocketpy/common.h b/include/pocketpy/common.h index 519b5324..0b4f326d 100644 --- a/include/pocketpy/common.h +++ b/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(p)) +#define PK_BITS(p) (reinterpret_cast(p)) #define PK_SMALL_INT(val) (reinterpret_cast(val << 2 | 0b10)) inline PyObject* tag_float(f64 val){ diff --git a/src/ceval.cpp b/src/ceval.cpp index 73537281..a5e06efb 100644 --- a/src/ceval.cpp +++ b/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() \ }