Fix incorrect types passed to Py_BuildValue and PyArg_ParseTupleAndKeywords #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Always using
i
is broken, as that is 4 bytes, butPy_ssize_t
andPy_uintptr_t
are 8 bytes.On little endian machines, this is usually fine, since the first 4 bytes (of 4-byte or 8-byte integers) will be the same, but on big-endian machines, a 4-byte integer corresponds with the last 4 bytes of the 8-byte integer
For small numbers on big-endian machines, it is thus likely that the result will be 0. If the value is over 32 bits, then the result will be wrong on little-endian machines as well.
Fixes #142