Use Py_ssize_t instead of ssize_t

This commit is contained in:
Christoph Gohlke 2014-12-19 01:28:21 -08:00
parent 7e8644fbfa
commit b8fafdef69

View File

@ -413,7 +413,7 @@ ImagingIncrementalCodecBytesInBuffer(ImagingIncrementalCodec codec)
return codec->stream.ptr - codec->stream.buffer; return codec->stream.ptr - codec->stream.buffer;
} }
ssize_t Py_ssize_t
ImagingIncrementalCodecRead(ImagingIncrementalCodec codec, ImagingIncrementalCodecRead(ImagingIncrementalCodec codec,
void *buffer, size_t bytes) void *buffer, size_t bytes)
{ {
@ -428,7 +428,7 @@ ImagingIncrementalCodecRead(ImagingIncrementalCodec codec,
DEBUG("reading (want %llu bytes)\n", (unsigned long long)bytes); DEBUG("reading (want %llu bytes)\n", (unsigned long long)bytes);
if (codec->stream.fd >= 0) { if (codec->stream.fd >= 0) {
ssize_t ret = read(codec->stream.fd, buffer, bytes); Py_ssize_t ret = read(codec->stream.fd, buffer, bytes);
DEBUG("read %lld bytes from fd\n", (long long)ret); DEBUG("read %lld bytes from fd\n", (long long)ret);
return ret; return ret;
} }
@ -497,7 +497,7 @@ ImagingIncrementalCodecSkip(ImagingIncrementalCodec codec,
off_t done = 0; off_t done = 0;
while (bytes) { while (bytes) {
size_t todo = (size_t)(bytes > 256 ? 256 : bytes); size_t todo = (size_t)(bytes > 256 ? 256 : bytes);
ssize_t written = ImagingIncrementalCodecWrite(codec, zeroes, todo); Py_ssize_t written = ImagingIncrementalCodecWrite(codec, zeroes, todo);
if (written <= 0) if (written <= 0)
break; break;
done += written; done += written;
@ -554,7 +554,7 @@ ImagingIncrementalCodecSkip(ImagingIncrementalCodec codec,
return done; return done;
} }
ssize_t Py_ssize_t
ImagingIncrementalCodecWrite(ImagingIncrementalCodec codec, ImagingIncrementalCodecWrite(ImagingIncrementalCodec codec,
const void *buffer, size_t bytes) const void *buffer, size_t bytes)
{ {