summaryrefslogtreecommitdiff
path: root/source/fitz/output.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/output.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/output.c')
-rw-r--r--source/fitz/output.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/fitz/output.c b/source/fitz/output.c
index 07422955..0fc4fc09 100644
--- a/source/fitz/output.c
+++ b/source/fitz/output.c
@@ -7,7 +7,7 @@ struct fz_output_context_s
fz_output *err;
};
-static void std_write(fz_context *ctx, void *opaque, const void *buffer, int count);
+static void std_write(fz_context *ctx, void *opaque, const void *buffer, size_t count);
static fz_output fz_stdout_global = {
&fz_stdout_global,
@@ -83,12 +83,12 @@ fz_stderr(fz_context *ctx)
}
static void
-file_write(fz_context *ctx, void *opaque, const void *buffer, int count)
+file_write(fz_context *ctx, void *opaque, const void *buffer, size_t count)
{
FILE *file = opaque;
size_t n;
- if (count < 0)
+ if (count == 0)
return;
if (count == 1)
@@ -100,12 +100,12 @@ file_write(fz_context *ctx, void *opaque, const void *buffer, int count)
}
n = fwrite(buffer, 1, count, file);
- if (n < (size_t)count && ferror(file))
+ if (n < count && ferror(file))
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot fwrite: %s", strerror(errno));
}
static void
-std_write(fz_context *ctx, void *opaque, const void *buffer, int count)
+std_write(fz_context *ctx, void *opaque, const void *buffer, size_t count)
{
FILE *f = opaque == &fz_stdout_global ? stdout : opaque == &fz_stderr_global ? stderr : NULL;
file_write(ctx, f, buffer, count);
@@ -177,7 +177,7 @@ fz_new_output_with_path(fz_context *ctx, const char *filename, int append)
}
static void
-buffer_write(fz_context *ctx, void *opaque, const void *data, int len)
+buffer_write(fz_context *ctx, void *opaque, const void *data, size_t len)
{
fz_buffer *buffer = opaque;
fz_write_buffer(ctx, buffer, data, len);
@@ -243,7 +243,7 @@ void
fz_vprintf(fz_context *ctx, fz_output *out, const char *fmt, va_list old_args)
{
char buffer[256], *p = buffer;
- int len;
+ size_t len;
va_list args;
if (!out) return;