From a94e208db35e4f4c45cbfe58625ab450d3ed295d Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 25 Apr 2020 23:25:18 -0400 Subject: [PATCH] Use T_PYSSIZET for GraphicsManager.image_count GraphicsManager.image_count is declared as a size_t, so the Python type needs to be the same width. On 64-bit big-endian architectures, this mismatch was showing up as test failures: ====================================================================== FAIL: test_gr_delete (kitty_tests.graphics.TestGraphics) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<>/kitty_tests/graphics.py", line 319, in test_gr_delete self.ae(len(layers(s)), 0), self.ae(s.grman.image_count, 1) ch = 20 cw = 10 delete = .delete at 0x3ffb7fc38b0> dx = 0.2 dy = 0.4 layers = .layers at 0x3ffb77709d0> put_image = .put_image at 0x3ffb77708b0> put_ref = .put_ref at 0x3ffb7770940> rect_eq = .rect_eq at 0x3ffb7770a60> s = self = AssertionError: 0 != 1 --- kitty/graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/graphics.c b/kitty/graphics.c index 115376255..a41a675a8 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -939,7 +939,7 @@ static PyMethodDef methods[] = { }; static PyMemberDef members[] = { - {"image_count", T_UINT, offsetof(GraphicsManager, image_count), 0, "image_count"}, + {"image_count", T_PYSSIZET, offsetof(GraphicsManager, image_count), 0, "image_count"}, {NULL}, };