summaryrefslogtreecommitdiff
path: root/source/fitz/stream-read.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-06-14 17:06:50 +0100
committerRobin Watts <robin.watts@artifex.com>2016-06-17 13:24:47 +0100
commit4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca (patch)
tree4ed45be7545229ce5d8bb124a8332b5444004b1b /source/fitz/stream-read.c
parentc9bad4ef3e32bc799b134bc3b258f9392cf60e3e (diff)
downloadmupdf-4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca.tar.xz
Use 'size_t' instead of int as appropriate.
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
Diffstat (limited to 'source/fitz/stream-read.c')
-rw-r--r--source/fitz/stream-read.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/fitz/stream-read.c b/source/fitz/stream-read.c
index 2ace7b1f..b499d68f 100644
--- a/source/fitz/stream-read.c
+++ b/source/fitz/stream-read.c
@@ -2,10 +2,10 @@
#define MIN_BOMB (100 << 20)
-int
-fz_read(fz_context *ctx, fz_stream *stm, unsigned char *buf, int len)
+size_t
+fz_read(fz_context *ctx, fz_stream *stm, unsigned char *buf, size_t len)
{
- int count, n;
+ size_t count, n;
count = 0;
do
@@ -29,9 +29,9 @@ fz_read(fz_context *ctx, fz_stream *stm, unsigned char *buf, int len)
static unsigned char skip_buf[4096];
-int fz_skip(fz_context *ctx, fz_stream *stm, int len)
+size_t fz_skip(fz_context *ctx, fz_stream *stm, size_t len)
{
- int count, l, total = 0;
+ size_t count, l, total = 0;
while (len)
{
@@ -48,16 +48,16 @@ int fz_skip(fz_context *ctx, fz_stream *stm, int len)
}
fz_buffer *
-fz_read_all(fz_context *ctx, fz_stream *stm, int initial)
+fz_read_all(fz_context *ctx, fz_stream *stm, size_t initial)
{
return fz_read_best(ctx, stm, initial, NULL);
}
fz_buffer *
-fz_read_best(fz_context *ctx, fz_stream *stm, int initial, int *truncated)
+fz_read_best(fz_context *ctx, fz_stream *stm, size_t initial, int *truncated)
{
fz_buffer *buf = NULL;
- int n;
+ size_t n;
fz_var(buf);
@@ -110,7 +110,7 @@ fz_read_best(fz_context *ctx, fz_stream *stm, int initial, int *truncated)
}
char *
-fz_read_line(fz_context *ctx, fz_stream *stm, char *mem, int n)
+fz_read_line(fz_context *ctx, fz_stream *stm, char *mem, size_t n)
{
char *s = mem;
int c = EOF;