diff options
-rw-r--r-- | Modules/arraymodule.c | 4 | ||||
-rw-r--r-- | Modules/cPickle.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index ec1b08d..6648c9c 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1039,8 +1039,8 @@ array_tofile(arrayobject *self, PyObject *args) return NULL; } if (self->ob_size > 0) { - if ((int)fwrite(self->ob_item, self->ob_descr->itemsize, - self->ob_size, fp) != self->ob_size) { + if (fwrite(self->ob_item, self->ob_descr->itemsize, + self->ob_size, fp) != (size_t)self->ob_size) { PyErr_SetFromErrno(PyExc_IOError); clearerr(fp); return NULL; diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 5a136b9..b64b1f1 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -407,7 +407,7 @@ write_file(Picklerobject *self, char *s, int n) { return 0; } - if ((int)fwrite(s, sizeof(char), n, self->fp) != n) { + if (fwrite(s, sizeof(char), n, self->fp) != (size_t)n) { PyErr_SetFromErrno(PyExc_IOError); return -1; } @@ -503,7 +503,7 @@ read_file(Unpicklerobject *self, char **s, int n) { self->buf_size = n; } - if ((int)fread(self->buf, sizeof(char), n, self->fp) != n) { + if (fread(self->buf, sizeof(char), n, self->fp) != (size_t)n) { if (feof(self->fp)) { PyErr_SetNone(PyExc_EOFError); return -1; |