summaryrefslogtreecommitdiff
path: root/include/mupdf/fitz/buffer.h
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 /include/mupdf/fitz/buffer.h
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 'include/mupdf/fitz/buffer.h')
-rw-r--r--include/mupdf/fitz/buffer.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/mupdf/fitz/buffer.h b/include/mupdf/fitz/buffer.h
index 1a8eb80c..a616fa86 100644
--- a/include/mupdf/fitz/buffer.h
+++ b/include/mupdf/fitz/buffer.h
@@ -36,13 +36,13 @@ void fz_drop_buffer(fz_context *ctx, fz_buffer *buf);
Returns length of stream.
*/
-int fz_buffer_storage(fz_context *ctx, fz_buffer *buf, unsigned char **data);
+size_t fz_buffer_storage(fz_context *ctx, fz_buffer *buf, unsigned char **data);
struct fz_buffer_s
{
int refs;
unsigned char *data;
- int cap, len;
+ size_t cap, len;
int unused_bits;
int shared;
};
@@ -55,7 +55,7 @@ struct fz_buffer_s
Returns pointer to new buffer. Throws exception on allocation
failure.
*/
-fz_buffer *fz_new_buffer(fz_context *ctx, int capacity);
+fz_buffer *fz_new_buffer(fz_context *ctx, size_t capacity);
/*
fz_new_buffer_from_data: Create a new buffer with existing data.
@@ -70,17 +70,17 @@ fz_buffer *fz_new_buffer(fz_context *ctx, int capacity);
Returns pointer to new buffer. Throws exception on allocation
failure.
*/
-fz_buffer *fz_new_buffer_from_data(fz_context *ctx, unsigned char *data, int size);
+fz_buffer *fz_new_buffer_from_data(fz_context *ctx, unsigned char *data, size_t size);
/*
fz_new_buffer_from_shared_data: Like fz_new_buffer, but does not take ownership.
*/
-fz_buffer *fz_new_buffer_from_shared_data(fz_context *ctx, const char *data, int size);
+fz_buffer *fz_new_buffer_from_shared_data(fz_context *ctx, const char *data, size_t size);
/*
fz_new_buffer_from_base64: Create a new buffer with data decoded from a base64 input string.
*/
-fz_buffer *fz_new_buffer_from_base64(fz_context *ctx, const char *data, int size);
+fz_buffer *fz_new_buffer_from_base64(fz_context *ctx, const char *data, size_t size);
/*
fz_resize_buffer: Ensure that a buffer has a given capacity,
@@ -92,7 +92,7 @@ fz_buffer *fz_new_buffer_from_base64(fz_context *ctx, const char *data, int size
of the buffer contents is smaller than capacity, it is truncated.
*/
-void fz_resize_buffer(fz_context *ctx, fz_buffer *buf, int capacity);
+void fz_resize_buffer(fz_context *ctx, fz_buffer *buf, size_t capacity);
/*
fz_grow_buffer: Make some space within a buffer (i.e. ensure that
@@ -127,15 +127,15 @@ void fz_append_buffer(fz_context *ctx, fz_buffer *buf, fz_buffer *extra);
fz_buffer_print_pdfstring: Print a string using PDF syntax and escapes.
The buffer will grow as required.
*/
-void fz_write_buffer(fz_context *ctx, fz_buffer *buf, const void *data, int len);
+void fz_write_buffer(fz_context *ctx, fz_buffer *buf, const void *data, size_t len);
void fz_write_buffer_byte(fz_context *ctx, fz_buffer *buf, int val);
void fz_write_buffer_rune(fz_context *ctx, fz_buffer *buf, int val);
void fz_write_buffer_int32_le(fz_context *ctx, fz_buffer *buf, int x);
void fz_write_buffer_int16_le(fz_context *ctx, fz_buffer *buf, int x);
void fz_write_buffer_bits(fz_context *ctx, fz_buffer *buf, int val, int bits);
void fz_write_buffer_pad(fz_context *ctx, fz_buffer *buf);
-int fz_buffer_printf(fz_context *ctx, fz_buffer *buffer, const char *fmt, ...);
-int fz_buffer_vprintf(fz_context *ctx, fz_buffer *buffer, const char *fmt, va_list args);
+size_t fz_buffer_printf(fz_context *ctx, fz_buffer *buffer, const char *fmt, ...);
+size_t fz_buffer_vprintf(fz_context *ctx, fz_buffer *buffer, const char *fmt, va_list args);
void fz_buffer_print_pdf_string(fz_context *ctx, fz_buffer *buffer, const char *text);
#endif