diff --git a/NEWS.rst b/NEWS.rst index 53b5667a..da42f57c 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -59,6 +59,11 @@ Bug Fixes * ``zstd_cffi.py`` added to ``setup.py`` (#60). +Changes +------- + +* Change some integer casts to avoid ``ssize_t`` (#61). + 0.10.1 (released 2018-10-08) ============================ diff --git a/c-ext/compressionwriter.c b/c-ext/compressionwriter.c index 7a5be1be..cab6f52a 100644 --- a/c-ext/compressionwriter.c +++ b/c-ext/compressionwriter.c @@ -153,7 +153,7 @@ static PyObject* ZstdCompressionWriter_write(ZstdCompressionWriter* self, PyObje input.size = source.len; input.pos = 0; - while ((ssize_t)input.pos < source.len) { + while (input.pos < (size_t)source.len) { Py_BEGIN_ALLOW_THREADS zresult = ZSTD_compress_generic(self->compressor->cctx, &output, &input, ZSTD_e_continue); Py_END_ALLOW_THREADS diff --git a/c-ext/compressobj.c b/c-ext/compressobj.c index 3ce0db9d..30399458 100644 --- a/c-ext/compressobj.c +++ b/c-ext/compressobj.c @@ -59,7 +59,7 @@ static PyObject* ZstdCompressionObj_compress(ZstdCompressionObj* self, PyObject* input.size = source.len; input.pos = 0; - while ((ssize_t)input.pos < source.len) { + while (input.pos < (size_t)source.len) { Py_BEGIN_ALLOW_THREADS zresult = ZSTD_compress_generic(self->compressor->cctx, &self->output, &input, ZSTD_e_continue); diff --git a/c-ext/decompressionwriter.c b/c-ext/decompressionwriter.c index ee888791..e9084a1b 100644 --- a/c-ext/decompressionwriter.c +++ b/c-ext/decompressionwriter.c @@ -93,7 +93,7 @@ static PyObject* ZstdDecompressionWriter_write(ZstdDecompressionWriter* self, Py input.size = source.len; input.pos = 0; - while ((ssize_t)input.pos < source.len) { + while (input.pos < (size_t)source.len) { Py_BEGIN_ALLOW_THREADS zresult = ZSTD_decompress_generic(self->decompressor->dctx, &output, &input); Py_END_ALLOW_THREADS