summaryrefslogtreecommitdiff
path: root/include/mupdf/fitz
diff options
context:
space:
mode:
Diffstat (limited to 'include/mupdf/fitz')
-rw-r--r--include/mupdf/fitz/compressed-buffer.h2
-rw-r--r--include/mupdf/fitz/context.h22
-rw-r--r--include/mupdf/fitz/function.h2
-rw-r--r--include/mupdf/fitz/glyph.h4
-rw-r--r--include/mupdf/fitz/pixmap.h2
-rw-r--r--include/mupdf/fitz/store.h6
-rw-r--r--include/mupdf/fitz/system.h9
7 files changed, 28 insertions, 19 deletions
diff --git a/include/mupdf/fitz/compressed-buffer.h b/include/mupdf/fitz/compressed-buffer.h
index eccfe8c7..97a68cc2 100644
--- a/include/mupdf/fitz/compressed-buffer.h
+++ b/include/mupdf/fitz/compressed-buffer.h
@@ -9,7 +9,7 @@
typedef struct fz_compression_params_s fz_compression_params;
typedef struct fz_compressed_buffer_s fz_compressed_buffer;
-unsigned int fz_compressed_buffer_size(fz_compressed_buffer *buffer);
+size_t fz_compressed_buffer_size(fz_compressed_buffer *buffer);
fz_stream *fz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *);
fz_stream *fz_open_image_decomp_stream_from_buffer(fz_context *ctx, fz_compressed_buffer *, int *l2factor);
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h
index 2d902e62..35c88c91 100644
--- a/include/mupdf/fitz/context.h
+++ b/include/mupdf/fitz/context.h
@@ -29,8 +29,8 @@ typedef struct fz_context_s fz_context;
struct fz_alloc_context_s
{
void *user;
- void *(*malloc)(void *, unsigned int);
- void *(*realloc)(void *, void *, unsigned int);
+ void *(*malloc)(void *, size_t);
+ void *(*realloc)(void *, void *, size_t);
void (*free)(void *, void *);
};
@@ -169,7 +169,7 @@ enum {
Does not throw exceptions, but may return NULL.
*/
-fz_context *fz_new_context_imp(const fz_alloc_context *alloc, const fz_locks_context *locks, unsigned int max_store, const char *version);
+fz_context *fz_new_context_imp(const fz_alloc_context *alloc, const fz_locks_context *locks, size_t max_store, const char *version);
#define fz_new_context(alloc, locks, max_store) fz_new_context_imp(alloc, locks, max_store, FZ_VERSION)
@@ -392,7 +392,7 @@ enum {
Returns a pointer to the allocated block. May return NULL if size is
0. Throws exception on failure to allocate.
*/
-void *fz_malloc(fz_context *ctx, unsigned int size);
+void *fz_malloc(fz_context *ctx, size_t size);
/*
fz_calloc: Allocate a zeroed block of memory (with scavenging)
@@ -404,7 +404,7 @@ void *fz_malloc(fz_context *ctx, unsigned int size);
Returns a pointer to the allocated block. May return NULL if size
and/or count are 0. Throws exception on failure to allocate.
*/
-void *fz_calloc(fz_context *ctx, unsigned int count, unsigned int size);
+void *fz_calloc(fz_context *ctx, size_t count, size_t size);
/*
fz_malloc_struct: Allocate storage for a structure (with scavenging),
@@ -432,7 +432,7 @@ void *fz_calloc(fz_context *ctx, unsigned int count, unsigned int size);
Returns a pointer to the allocated block. May return NULL if size
and/or count are 0. Throws exception on failure to allocate.
*/
-void *fz_malloc_array(fz_context *ctx, unsigned int count, unsigned int size);
+void *fz_malloc_array(fz_context *ctx, size_t count, size_t size);
/*
fz_resize_array: Resize a block of memory (with scavenging).
@@ -447,7 +447,7 @@ void *fz_malloc_array(fz_context *ctx, unsigned int count, unsigned int size);
and/or count are 0. Throws exception on failure to resize (original
block is left unchanged).
*/
-void *fz_resize_array(fz_context *ctx, void *p, unsigned int count, unsigned int size);
+void *fz_resize_array(fz_context *ctx, void *p, size_t count, size_t size);
/*
fz_strdup: Duplicate a C string (with scavenging)
@@ -474,7 +474,7 @@ void fz_free(fz_context *ctx, void *p);
Returns a pointer to the allocated block. May return NULL if size is
0. Returns NULL on failure to allocate.
*/
-void *fz_malloc_no_throw(fz_context *ctx, unsigned int size);
+void *fz_malloc_no_throw(fz_context *ctx, size_t size);
/*
fz_calloc_no_throw: Allocate a zeroed block of memory (with scavenging)
@@ -486,7 +486,7 @@ void *fz_malloc_no_throw(fz_context *ctx, unsigned int size);
Returns a pointer to the allocated block. May return NULL if size
and/or count are 0. Returns NULL on failure to allocate.
*/
-void *fz_calloc_no_throw(fz_context *ctx, unsigned int count, unsigned int size);
+void *fz_calloc_no_throw(fz_context *ctx, size_t count, size_t size);
/*
fz_malloc_array_no_throw: Allocate a block of (non zeroed) memory
@@ -500,7 +500,7 @@ void *fz_calloc_no_throw(fz_context *ctx, unsigned int count, unsigned int size)
Returns a pointer to the allocated block. May return NULL if size
and/or count are 0. Returns NULL on failure to allocate.
*/
-void *fz_malloc_array_no_throw(fz_context *ctx, unsigned int count, unsigned int size);
+void *fz_malloc_array_no_throw(fz_context *ctx, size_t count, size_t size);
/*
fz_resize_array_no_throw: Resize a block of memory (with scavenging).
@@ -515,7 +515,7 @@ void *fz_malloc_array_no_throw(fz_context *ctx, unsigned int count, unsigned int
and/or count are 0. Returns NULL on failure to resize (original
block is left unchanged).
*/
-void *fz_resize_array_no_throw(fz_context *ctx, void *p, unsigned int count, unsigned int size);
+void *fz_resize_array_no_throw(fz_context *ctx, void *p, size_t count, size_t size);
/*
fz_strdup_no_throw: Duplicate a C string (with scavenging)
diff --git a/include/mupdf/fitz/function.h b/include/mupdf/fitz/function.h
index 0d17da6d..17fb8e15 100644
--- a/include/mupdf/fitz/function.h
+++ b/include/mupdf/fitz/function.h
@@ -15,7 +15,7 @@ typedef struct fz_function_s fz_function;
void fz_eval_function(fz_context *ctx, fz_function *func, const float *in, int inlen, float *out, int outlen);
fz_function *fz_keep_function(fz_context *ctx, fz_function *func);
void fz_drop_function(fz_context *ctx, fz_function *func);
-unsigned int fz_function_size(fz_context *ctx, fz_function *func);
+size_t fz_function_size(fz_context *ctx, fz_function *func);
void fz_print_function(fz_context *ctx, fz_output *out, fz_function *func);
enum
diff --git a/include/mupdf/fitz/glyph.h b/include/mupdf/fitz/glyph.h
index 1839ed6a..a4b985b5 100644
--- a/include/mupdf/fitz/glyph.h
+++ b/include/mupdf/fitz/glyph.h
@@ -122,11 +122,11 @@ struct fz_glyph_s
unsigned char data[1];
};
-static unsigned int fz_glyph_size(fz_context *ctx, fz_glyph *glyph);
+static size_t fz_glyph_size(fz_context *ctx, fz_glyph *glyph);
fz_irect *fz_glyph_bbox_no_ctx(fz_glyph *src, fz_irect *bbox);
-static inline unsigned int
+static inline size_t
fz_glyph_size(fz_context *ctx, fz_glyph *glyph)
{
if (glyph == NULL)
diff --git a/include/mupdf/fitz/pixmap.h b/include/mupdf/fitz/pixmap.h
index c784303c..4334a1e2 100644
--- a/include/mupdf/fitz/pixmap.h
+++ b/include/mupdf/fitz/pixmap.h
@@ -316,7 +316,7 @@ void fz_drop_pixmap_imp(fz_context *ctx, fz_storable *pix);
void fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_irect *r);
void fz_premultiply_pixmap(fz_context *ctx, fz_pixmap *pix);
fz_pixmap *fz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray, int luminosity);
-unsigned int fz_pixmap_size(fz_context *ctx, fz_pixmap *pix);
+size_t fz_pixmap_size(fz_context *ctx, fz_pixmap *pix);
fz_pixmap *fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip);
diff --git a/include/mupdf/fitz/store.h b/include/mupdf/fitz/store.h
index 5dbf5538..e9b81539 100644
--- a/include/mupdf/fitz/store.h
+++ b/include/mupdf/fitz/store.h
@@ -107,7 +107,7 @@ struct fz_store_type_s
max: The maximum size (in bytes) that the store is allowed to grow
to. FZ_STORE_UNLIMITED means no limit.
*/
-void fz_new_store_context(fz_context *ctx, unsigned int max);
+void fz_new_store_context(fz_context *ctx, size_t max);
/*
fz_drop_store_context: Drop a reference to the store.
@@ -137,7 +137,7 @@ fz_store *fz_keep_store_context(fz_context *ctx);
type: Functions used to manipulate the key.
*/
-void *fz_store_item(fz_context *ctx, void *key, void *val, unsigned int itemsize, fz_store_type *type);
+void *fz_store_item(fz_context *ctx, void *key, void *val, size_t itemsize, fz_store_type *type);
/*
fz_find_item: Find an item within the store.
@@ -185,7 +185,7 @@ void fz_empty_store(fz_context *ctx);
Returns non zero if we managed to free any memory.
*/
-int fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase);
+int fz_store_scavenge(fz_context *ctx, size_t size, int *phase);
/*
fz_shrink_store: Evict items from the store until the total size of
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index be5504a5..72d17c83 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -199,6 +199,15 @@ typedef int fz_off_t;
#define fz_atoo_imp atoi
#endif
+/* Portable way to format a size_t */
+#if defined(_WIN64)
+#define FMT_zu "%Iu"
+#elif defined(_WIN32)
+#define FMT_zu "%u"
+#else
+#define FMT_zu "%zu"
+#endif
+
#ifdef __ANDROID__
#include <android/log.h>
#define LOG_TAG "libmupdf"