-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c-ext: change casts between Py_ssize_t and size_t
In all these cases, we are comparing a Py_ssize_t (from Python obviously) with a size_t in zstd. The Py_ssize_t type is signed. But in these cases, the value refers to the length of a Py_buffer. The length of a Py_buffer can never be negative. And the size of Py_ssize_t must be the same as size_t. So it follows that casting a Py_buffer to size_t should be safe. This avoids the use of ssize_t in our code. And this should hopefully unblock building the extension with PyPy on Windows. Fixes #61.
- Loading branch information
Showing
4 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters