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 "/<<PKGBUILDDIR>>/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 = <function TestGraphics.test_gr_delete.<locals>.delete at 0x3ffb7fc38b0>
dx = 0.2
dy = 0.4
layers = <function put_helpers.<locals>.layers at 0x3ffb77709d0>
put_image = <function put_helpers.<locals>.put_image at 0x3ffb77708b0>
put_ref = <function put_helpers.<locals>.put_ref at 0x3ffb7770940>
rect_eq = <function put_helpers.<locals>.rect_eq at 0x3ffb7770a60>
s = <fast_data_types.Screen object at 0x1b60df0>
self = <kitty_tests.graphics.TestGraphics testMethod=test_gr_delete>
AssertionError: 0 != 1
The time is stored in a signed 64 bit integer with nanosecond accuracy. This eliminates the possibility of floating-point inaccuracies.
`monotonic_t` can currently hold values large enough to work correctly for more than 200 years into the future.
Using a typedef instead of directly using `int64_t` everywhere will also allow easily changing the datatype in the future should the need arise for more precise or bigger time values.
Debian's [mips] build failed one of the font tests:
FAIL: test_sprite_map (kitty_tests.fonts.Rendering)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/kitty_tests/fonts.py", line 48, in test_sprite_map
self.ae(test_sprite_position_for(0, 1), (0, 1, 1))
self = <kitty_tests.fonts.Rendering testMethod=test_sprite_map>
AssertionError: Tuples differ: (0, 0, 0) != (0, 1, 1)
First differing element 1:
0
1
- (0, 0, 0)
? ^ ^
+ (0, 1, 1)
? ^ ^
This was due to test_sprite_position_for() using the "I" code to parse
into an unsigned short. Since mips is big endian, the "wrong" byte was
stored into extra_glyphs.data.
This commit changes all similar data type mismatches that were found
from auditing calls to PyArg_ParseTuple/Py_BuildValue.
[mips]: https://buildd.debian.org/status/fetch.php?pkg=kitty&arch=mips&ver=0.9.0-1&stamp=1524126606&raw=0