mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
types: handle ssize_t is int
This commit is contained in:
parent
5624659d37
commit
e35029a749
2 changed files with 5 additions and 5 deletions
|
@ -155,11 +155,11 @@ _lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount,
|
|||
*amount = 0;
|
||||
return -1;
|
||||
}
|
||||
fop_fd->pos += (size_t)n;
|
||||
fop_fd->pos = (lws_filepos_t)(fop_fd->pos + (lws_filepos_t)n);
|
||||
lwsl_debug("%s: read %ld of req %ld, pos %ld, len %ld\n", __func__,
|
||||
(long)n, (long)len, (long)fop_fd->pos,
|
||||
(long)fop_fd->len);
|
||||
*amount = (size_t)n;
|
||||
*amount = (lws_filepos_t)n;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -176,8 +176,8 @@ _lws_plat_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount,
|
|||
return -1;
|
||||
}
|
||||
|
||||
fop_fd->pos += (size_t)n;
|
||||
*amount = (size_t)n;
|
||||
fop_fd->pos = (lws_filepos_t)(fop_fd->pos + (lws_filepos_t)n);
|
||||
*amount = (lws_filepos_t)n;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ int alloc_file(struct lws_context *context, const char *filename, uint8_t **buf,
|
|||
goto bail;
|
||||
}
|
||||
|
||||
m = ftell(f);
|
||||
m = (ssize_t)ftell(f);
|
||||
if (m == -1l) {
|
||||
n = 1;
|
||||
goto bail;
|
||||
|
|
Loading…
Add table
Reference in a new issue