test(CPythonTest): PyLong_FromLong/AsLong 按 Windows LLP64 long=32 位改用 t.CInt
TPV 恒映射 t.CLong=i64,而 Windows x64 下 C long 为 32 位:PyLong_AsLong 实际返回 EAX 32 位,按 i64 读负数被零扩展(-999 → 4294966297)导致 比较 FAIL;改用 t.CInt(i32)与 ABI 一致,负数由赋值处 sext 正确扩展
This commit is contained in:
1 parent
f3b16c397c
commit
4f59396d5c
1 file changed
+2
-2
@@ -110,14 +110,14 @@ def PyStatus_Exception(status: PySTATUS) -> t.CInt | t.State: pass
|
||||
# ============================================================
|
||||
# 整数操作 (PyLong)
|
||||
# ============================================================
|
||||
def PyLong_FromLong(v: t.CLong) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_FromLong(v: t.CInt) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_FromUnsignedLong(v: t.CUnsignedLong) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_FromLongLong(v: t.CLong) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_FromUnsignedLongLong(v: t.CUnsignedLong) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_FromSsize_t(v: t.CPtrDiffT) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_FromSize_t(v: t.CSizeT) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_FromDouble(v: t.CDouble) -> PyObject | t.CPtr | t.State: pass
|
||||
def PyLong_AsLong(obj: PyObject | t.CPtr) -> t.CLong | t.State: pass
|
||||
def PyLong_AsLong(obj: PyObject | t.CPtr) -> t.CInt | t.State: pass
|
||||
def PyLong_AsUnsignedLong(obj: PyObject | t.CPtr) -> t.CUnsignedLong | t.State: pass
|
||||
def PyLong_AsLongLong(obj: PyObject | t.CPtr) -> t.CLong | t.State: pass
|
||||
def PyLong_AsUnsignedLongLong(obj: PyObject | t.CPtr) -> t.CUnsignedLong | t.State: pass
|
||||
|
||||
Reference in new issue
Block a user