Solved some type conversion warnings; replaced #warning with // TODO

This commit is contained in:
Gianluca Bertani
2015-09-09 21:00:36 +02:00
parent dbd1e5962f
commit 94312b945e
7 changed files with 23 additions and 23 deletions
+3 -3
View File
@@ -253,7 +253,7 @@ local gzFile gz_open(path, fd, mode)
/* save the current position for rewinding (only if reading) */
if (state->mode == GZ_READ) {
state->start = LSEEK(state->fd, 0, SEEK_CUR);
state->start = (z_off64_t) LSEEK(state->fd, 0, SEEK_CUR);
if (state->start == -1) state->start = 0;
}
@@ -393,7 +393,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
/* if within raw area while reading, just go there */
if (state->mode == GZ_READ && state->how == COPY &&
state->x.pos + offset >= 0) {
ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
ret = (z_off64_t) LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
if (ret == -1)
return -1;
state->x.have = 0;
@@ -489,7 +489,7 @@ z_off64_t ZEXPORT gzoffset64(file)
return -1;
/* compute and return effective offset in file */
offset = LSEEK(state->fd, 0, SEEK_CUR);
offset = (z_off64_t) LSEEK(state->fd, 0, SEEK_CUR);
if (offset == -1)
return -1;
if (state->mode == GZ_READ) /* reading */
+1 -1
View File
@@ -27,7 +27,7 @@ local int gz_load(state, buf, len, have)
*have = 0;
do {
ret = read(state->fd, buf + *have, len - *have);
ret = (int) read(state->fd, buf + *have, len - *have);
if (ret <= 0)
break;
*have += ret;
+2 -2
View File
@@ -81,7 +81,7 @@ local int gz_comp(state, flush)
/* write directly if requested */
if (state->direct) {
got = write(state->fd, strm->next_in, strm->avail_in);
got = (int) write(state->fd, strm->next_in, strm->avail_in);
if (got < 0 || (unsigned)got != strm->avail_in) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
@@ -98,7 +98,7 @@ local int gz_comp(state, flush)
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
(flush != Z_FINISH || ret == Z_STREAM_END))) {
have = (unsigned)(strm->next_out - state->x.next);
if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
if (have && ((got = (int) write(state->fd, state->x.next, have)) < 0 ||
(unsigned)got != have)) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;