Merge pull request #1051 from cgohlke/patch-2

Use Py_ssize_t instead of ssize_t
This commit is contained in:
Hugo 2014-12-19 11:43:51 +02:00
commit f1ed79979b
2 changed files with 6 additions and 6 deletions

View File

@ -528,9 +528,9 @@ enum {
extern ImagingIncrementalCodec ImagingIncrementalCodecCreate(ImagingIncrementalCodecEntry codec_entry, Imaging im, ImagingCodecState state, int read_or_write, int seekable, int fd);
extern void ImagingIncrementalCodecDestroy(ImagingIncrementalCodec codec);
extern int ImagingIncrementalCodecPushBuffer(ImagingIncrementalCodec codec, UINT8 *buf, int bytes);
extern ssize_t ImagingIncrementalCodecRead(ImagingIncrementalCodec codec, void *buffer, size_t bytes);
extern Py_ssize_t ImagingIncrementalCodecRead(ImagingIncrementalCodec codec, void *buffer, size_t bytes);
extern off_t ImagingIncrementalCodecSkip(ImagingIncrementalCodec codec, off_t bytes);
extern ssize_t ImagingIncrementalCodecWrite(ImagingIncrementalCodec codec, const void *buffer, size_t bytes);
extern Py_ssize_t ImagingIncrementalCodecWrite(ImagingIncrementalCodec codec, const void *buffer, size_t bytes);
extern off_t ImagingIncrementalCodecSeek(ImagingIncrementalCodec codec, off_t bytes);
extern size_t ImagingIncrementalCodecBytesInBuffer(ImagingIncrementalCodec codec);

View File

@ -413,7 +413,7 @@ ImagingIncrementalCodecBytesInBuffer(ImagingIncrementalCodec codec)
return codec->stream.ptr - codec->stream.buffer;
}
ssize_t
Py_ssize_t
ImagingIncrementalCodecRead(ImagingIncrementalCodec codec,
void *buffer, size_t bytes)
{
@ -428,7 +428,7 @@ ImagingIncrementalCodecRead(ImagingIncrementalCodec codec,
DEBUG("reading (want %llu bytes)\n", (unsigned long long)bytes);
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);
return ret;
}
@ -497,7 +497,7 @@ ImagingIncrementalCodecSkip(ImagingIncrementalCodec codec,
off_t done = 0;
while (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)
break;
done += written;
@ -554,7 +554,7 @@ ImagingIncrementalCodecSkip(ImagingIncrementalCodec codec,
return done;
}
ssize_t
Py_ssize_t
ImagingIncrementalCodecWrite(ImagingIncrementalCodec codec,
const void *buffer, size_t bytes)
{