diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/buffer.h | 20 | ||||
-rw-r--r-- | include/mupdf/fitz/colorspace.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/crypt.h | 14 | ||||
-rw-r--r-- | include/mupdf/fitz/function.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/glyph.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/image.h | 36 | ||||
-rw-r--r-- | include/mupdf/fitz/math.h | 5 | ||||
-rw-r--r-- | include/mupdf/fitz/output.h | 8 | ||||
-rw-r--r-- | include/mupdf/fitz/pixmap.h | 5 | ||||
-rw-r--r-- | include/mupdf/fitz/stream.h | 20 | ||||
-rw-r--r-- | include/mupdf/fitz/string.h | 8 | ||||
-rw-r--r-- | include/mupdf/fitz/xml.h | 2 | ||||
-rw-r--r-- | include/mupdf/pdf/font.h | 10 | ||||
-rw-r--r-- | include/mupdf/pdf/object.h | 2 | ||||
-rw-r--r-- | include/mupdf/xps.h | 2 |
15 files changed, 72 insertions, 66 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 diff --git a/include/mupdf/fitz/colorspace.h b/include/mupdf/fitz/colorspace.h index cf635a8d..50c41864 100644 --- a/include/mupdf/fitz/colorspace.h +++ b/include/mupdf/fitz/colorspace.h @@ -71,7 +71,7 @@ void fz_set_device_cmyk(fz_context *ctx, fz_colorspace *cs); struct fz_colorspace_s { fz_storable storable; - unsigned int size; + size_t size; char name[16]; int n; void (*to_rgb)(fz_context *ctx, fz_colorspace *, const float *src, float *rgb); diff --git a/include/mupdf/fitz/crypt.h b/include/mupdf/fitz/crypt.h index 86365e81..6a6f5a2a 100644 --- a/include/mupdf/fitz/crypt.h +++ b/include/mupdf/fitz/crypt.h @@ -21,7 +21,7 @@ struct fz_md5_s }; void fz_md5_init(fz_md5 *state); -void fz_md5_update(fz_md5 *state, const unsigned char *input, unsigned inlen); +void fz_md5_update(fz_md5 *state, const unsigned char *input, size_t inlen); void fz_md5_final(fz_md5 *state, unsigned char digest[16]); /* sha-256 digests */ @@ -39,7 +39,7 @@ struct fz_sha256_s }; void fz_sha256_init(fz_sha256 *state); -void fz_sha256_update(fz_sha256 *state, const unsigned char *input, unsigned int inlen); +void fz_sha256_update(fz_sha256 *state, const unsigned char *input, size_t inlen); void fz_sha256_final(fz_sha256 *state, unsigned char digest[32]); /* sha-512 digests */ @@ -57,7 +57,7 @@ struct fz_sha512_s }; void fz_sha512_init(fz_sha512 *state); -void fz_sha512_update(fz_sha512 *state, const unsigned char *input, unsigned int inlen); +void fz_sha512_update(fz_sha512 *state, const unsigned char *input, size_t inlen); void fz_sha512_final(fz_sha512 *state, unsigned char digest[64]); /* sha-384 digests */ @@ -65,7 +65,7 @@ void fz_sha512_final(fz_sha512 *state, unsigned char digest[64]); typedef struct fz_sha512_s fz_sha384; void fz_sha384_init(fz_sha384 *state); -void fz_sha384_update(fz_sha384 *state, const unsigned char *input, unsigned int inlen); +void fz_sha384_update(fz_sha384 *state, const unsigned char *input, size_t inlen); void fz_sha384_final(fz_sha384 *state, unsigned char digest[64]); /* arc4 crypto */ @@ -79,8 +79,8 @@ struct fz_arc4_s unsigned char state[256]; }; -void fz_arc4_init(fz_arc4 *state, const unsigned char *key, unsigned len); -void fz_arc4_encrypt(fz_arc4 *state, unsigned char *dest, const unsigned char *src, unsigned len); +void fz_arc4_init(fz_arc4 *state, const unsigned char *key, size_t len); +void fz_arc4_encrypt(fz_arc4 *state, unsigned char *dest, const unsigned char *src, size_t len); /* AES block cipher implementation from XYSSL */ @@ -98,7 +98,7 @@ struct fz_aes_s int aes_setkey_enc( fz_aes *ctx, const unsigned char *key, int keysize ); int aes_setkey_dec( fz_aes *ctx, const unsigned char *key, int keysize ); -void aes_crypt_cbc( fz_aes *ctx, int mode, int length, +void aes_crypt_cbc( fz_aes *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output ); diff --git a/include/mupdf/fitz/function.h b/include/mupdf/fitz/function.h index 17fb8e15..ab49f57a 100644 --- a/include/mupdf/fitz/function.h +++ b/include/mupdf/fitz/function.h @@ -27,7 +27,7 @@ enum struct fz_function_s { fz_storable storable; - unsigned int size; + size_t size; int m; /* number of input values */ int n; /* number of output values */ void (*evaluate)(fz_context *ctx, fz_function *func, const float *in, float *out); diff --git a/include/mupdf/fitz/glyph.h b/include/mupdf/fitz/glyph.h index a4b985b5..e6780bd7 100644 --- a/include/mupdf/fitz/glyph.h +++ b/include/mupdf/fitz/glyph.h @@ -118,7 +118,7 @@ struct fz_glyph_s fz_storable storable; int x, y, w, h; fz_pixmap *pixmap; - int size; + size_t size; unsigned char data[1]; }; diff --git a/include/mupdf/fitz/image.h b/include/mupdf/fitz/image.h index 9a8d5309..c8cde1ac 100644 --- a/include/mupdf/fitz/image.h +++ b/include/mupdf/fitz/image.h @@ -67,7 +67,7 @@ typedef size_t (fz_image_get_size_fn)(fz_context *, fz_image *); fz_image *fz_new_image(fz_context *ctx, int w, int h, int bpc, fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, float *decode, int *colorkey, fz_image *mask, int size, fz_image_get_pixmap_fn *get, fz_image_get_size_fn *get_size, fz_drop_image_fn *drop); fz_image *fz_new_image_from_compressed_buffer(fz_context *ctx, int w, int h, int bpc, fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, float *decode, int *colorkey, fz_compressed_buffer *buffer, fz_image *mask); fz_image *fz_new_image_from_pixmap(fz_context *ctx, fz_pixmap *pixmap, fz_image *mask); -fz_image *fz_new_image_from_data(fz_context *ctx, unsigned char *data, int len); +fz_image *fz_new_image_from_data(fz_context *ctx, unsigned char *data, size_t len); fz_image *fz_new_image_from_buffer(fz_context *ctx, fz_buffer *buffer); fz_image *fz_new_image_from_file(fz_context *ctx, const char *path); void fz_drop_image_imp(fz_context *ctx, fz_storable *image); @@ -98,23 +98,23 @@ struct fz_image_s float decode[FZ_MAX_COLORS * 2]; }; -fz_pixmap *fz_load_jpeg(fz_context *ctx, unsigned char *data, int size); -fz_pixmap *fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *cs, int indexed); -fz_pixmap *fz_load_png(fz_context *ctx, unsigned char *data, int size); -fz_pixmap *fz_load_tiff(fz_context *ctx, unsigned char *data, int size); -fz_pixmap *fz_load_jxr(fz_context *ctx, unsigned char *data, int size); -fz_pixmap *fz_load_gif(fz_context *ctx, unsigned char *data, int size); -fz_pixmap *fz_load_bmp(fz_context *ctx, unsigned char *data, int size); - -void fz_load_jpeg_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); -void fz_load_png_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); -void fz_load_tiff_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); -void fz_load_jxr_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); -void fz_load_gif_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); -void fz_load_bmp_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); - -int fz_load_tiff_subimage_count(fz_context *ctx, unsigned char *buf, int len); -fz_pixmap *fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, int len, int subimage); +fz_pixmap *fz_load_jpeg(fz_context *ctx, unsigned char *data, size_t size); +fz_pixmap *fz_load_jpx(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace *cs, int indexed); +fz_pixmap *fz_load_png(fz_context *ctx, unsigned char *data, size_t size); +fz_pixmap *fz_load_tiff(fz_context *ctx, unsigned char *data, size_t size); +fz_pixmap *fz_load_jxr(fz_context *ctx, unsigned char *data, size_t size); +fz_pixmap *fz_load_gif(fz_context *ctx, unsigned char *data, size_t size); +fz_pixmap *fz_load_bmp(fz_context *ctx, unsigned char *data, size_t size); + +void fz_load_jpeg_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); +void fz_load_png_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); +void fz_load_tiff_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); +void fz_load_jxr_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); +void fz_load_gif_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); +void fz_load_bmp_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace); + +int fz_load_tiff_subimage_count(fz_context *ctx, unsigned char *buf, size_t len); +fz_pixmap *fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, size_t len, int subimage); void fz_image_resolution(fz_image *image, int *xres, int *yres); diff --git a/include/mupdf/fitz/math.h b/include/mupdf/fitz/math.h index be054e81..e6d98cc4 100644 --- a/include/mupdf/fitz/math.h +++ b/include/mupdf/fitz/math.h @@ -60,6 +60,11 @@ static inline int fz_mini(int a, int b) return (a < b ? a : b); } +static inline size_t fz_minz(size_t a, size_t b) +{ + return (a < b ? a : b); +} + static inline float fz_max(float a, float b) { return (a > b ? a : b); diff --git a/include/mupdf/fitz/output.h b/include/mupdf/fitz/output.h index 8e9ad170..d4abd712 100644 --- a/include/mupdf/fitz/output.h +++ b/include/mupdf/fitz/output.h @@ -15,7 +15,7 @@ typedef struct fz_output_s fz_output; struct fz_output_s { void *opaque; - void (*write)(fz_context *, void *opaque, const void *, int n); + void (*write)(fz_context *, void *opaque, const void *, size_t n); void (*seek)(fz_context *, void *opaque, fz_off_t off, int whence); fz_off_t (*tell)(fz_context *, void *opaque); void (*close)(fz_context *, void *opaque); @@ -71,7 +71,7 @@ void fz_drop_output(fz_context *, fz_output *); fz_write: Write data to output. */ -static inline void fz_write(fz_context *ctx, fz_output *out, const void *data, int size) +static inline void fz_write(fz_context *ctx, fz_output *out, const void *data, size_t size) { if (out) out->write(ctx, out->opaque, data, size); @@ -141,8 +141,8 @@ static inline void fz_write_rune(fz_context *ctx, fz_output *out, int rune) %z{d,u,x} indicates that the value is a size_t. %Z{d,u,x} indicates that the value is a fz_off_t. */ -int fz_vsnprintf(char *buffer, int space, const char *fmt, va_list args); -int fz_snprintf(char *buffer, int space, const char *fmt, ...); +size_t fz_vsnprintf(char *buffer, size_t space, const char *fmt, va_list args); +size_t fz_snprintf(char *buffer, size_t space, const char *fmt, ...); /* fz_tempfilename: Get a temporary filename based upon 'base'. diff --git a/include/mupdf/fitz/pixmap.h b/include/mupdf/fitz/pixmap.h index 4334a1e2..9ae78164 100644 --- a/include/mupdf/fitz/pixmap.h +++ b/include/mupdf/fitz/pixmap.h @@ -302,7 +302,8 @@ void fz_convert_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src); struct fz_pixmap_s { fz_storable storable; - int x, y, w, h, n, stride; + int x, y, w, h, n; + ptrdiff_t stride; int alpha; int interpolate; int xres, yres; @@ -332,7 +333,7 @@ fz_irect *fz_pixmap_bbox_no_ctx(const fz_pixmap *src, fz_irect *bbox); void fz_decode_tile(fz_context *ctx, fz_pixmap *pix, const float *decode); void fz_decode_indexed_tile(fz_context *ctx, fz_pixmap *pix, const float *decode, int maxval); -void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * restrict src, int n, int depth, int stride, int scale); +void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * restrict src, int n, int depth, size_t stride, int scale); /* fz_md5_pixmap: Return the md5 digest for a pixmap diff --git a/include/mupdf/fitz/stream.h b/include/mupdf/fitz/stream.h index 90b5ec22..ea7b57f3 100644 --- a/include/mupdf/fitz/stream.h +++ b/include/mupdf/fitz/stream.h @@ -68,7 +68,7 @@ fz_stream *fz_open_file_ptr(fz_context *ctx, FILE *file); Returns pointer to newly created stream. May throw exceptions on failure to allocate. */ -fz_stream *fz_open_memory(fz_context *ctx, unsigned char *data, int len); +fz_stream *fz_open_memory(fz_context *ctx, unsigned char *data, size_t len); /* fz_open_buffer: Open a buffer as a stream. @@ -133,7 +133,7 @@ void fz_seek(fz_context *ctx, fz_stream *stm, fz_off_t offset, int whence); Returns the number of bytes read. May throw exceptions. */ -int fz_read(fz_context *ctx, fz_stream *stm, unsigned char *data, int len); +size_t fz_read(fz_context *ctx, fz_stream *stm, unsigned char *data, size_t len); /* fz_skip: Read from a stream discarding data. @@ -144,7 +144,7 @@ int fz_read(fz_context *ctx, fz_stream *stm, unsigned char *data, int len); Returns the number of bytes read. May throw exceptions. */ -int fz_skip(fz_context *ctx, fz_stream *stm, int len); +size_t fz_skip(fz_context *ctx, fz_stream *stm, size_t len); /* fz_read_all: Read all of a stream into a buffer. @@ -156,7 +156,7 @@ int fz_skip(fz_context *ctx, fz_stream *stm, int len); Returns a buffer created from reading from the stream. May throw exceptions on failure to allocate. */ -fz_buffer *fz_read_all(fz_context *ctx, fz_stream *stm, int initial); +fz_buffer *fz_read_all(fz_context *ctx, fz_stream *stm, size_t initial); /* fz_read_file: Read all the contents of a file into a buffer. @@ -205,7 +205,7 @@ enum int fz_stream_meta(fz_context *ctx, fz_stream *stm, int key, int size, void *ptr); -typedef int (fz_stream_next_fn)(fz_context *ctx, fz_stream *stm, int max); +typedef int (fz_stream_next_fn)(fz_context *ctx, fz_stream *stm, size_t max); typedef void (fz_stream_close_fn)(fz_context *ctx, void *state); typedef void (fz_stream_seek_fn)(fz_context *ctx, fz_stream *stm, fz_off_t offset, int whence); typedef int (fz_stream_meta_fn)(fz_context *ctx, fz_stream *stm, int key, int size, void *ptr); @@ -243,7 +243,7 @@ fz_stream *fz_keep_stream(fz_context *ctx, fz_stream *stm); Returns a buffer created from reading from the stream. */ -fz_buffer *fz_read_best(fz_context *ctx, fz_stream *stm, int initial, int *truncated); +fz_buffer *fz_read_best(fz_context *ctx, fz_stream *stm, size_t initial, int *truncated); /* fz_read_line: Read a line from stream into the buffer until either a @@ -252,7 +252,7 @@ fz_buffer *fz_read_best(fz_context *ctx, fz_stream *stm, int initial, int *trunc Returns buf on success, and NULL when end of file occurs while no characters have been read. */ -char *fz_read_line(fz_context *ctx, fz_stream *stm, char *buf, int max); +char *fz_read_line(fz_context *ctx, fz_stream *stm, char *buf, size_t max); /* fz_available: Ask how many bytes are available immediately from @@ -269,7 +269,7 @@ char *fz_read_line(fz_context *ctx, fz_stream *stm, char *buf, int max); if we have hit EOF. The number of bytes returned here need have no relation to max (could be larger, could be smaller). */ -static inline size_t fz_available(fz_context *ctx, fz_stream *stm, int max) +static inline size_t fz_available(fz_context *ctx, fz_stream *stm, size_t max) { size_t len = stm->wp - stm->rp; int c = EOF; @@ -349,7 +349,7 @@ static inline int fz_is_eof(fz_context *ctx, fz_stream *stm) static inline unsigned int fz_read_bits(fz_context *ctx, fz_stream *stm, int n) { - unsigned int x; + int x; if (n <= stm->avail) { @@ -381,7 +381,7 @@ static inline unsigned int fz_read_bits(fz_context *ctx, fz_stream *stm, int n) static inline unsigned int fz_read_rbits(fz_context *ctx, fz_stream *stm, int n) { - unsigned int x; + int x; if (n <= stm->avail) { diff --git a/include/mupdf/fitz/string.h b/include/mupdf/fitz/string.h index 9f1f656b..358701d1 100644 --- a/include/mupdf/fitz/string.h +++ b/include/mupdf/fitz/string.h @@ -36,7 +36,7 @@ char *fz_strsep(char **stringp, const char *delim); Returns the length (excluding terminator) of src. */ -int fz_strlcpy(char *dst, const char *src, int n); +size_t fz_strlcpy(char *dst, const char *src, size_t n); /* fz_strlcat: Concatenate 2 strings, with a maximum length. @@ -50,12 +50,12 @@ int fz_strlcpy(char *dst, const char *src, int n); Returns the real length that a concatenated dst + src would have been (not including terminator). */ -int fz_strlcat(char *dst, const char *src, int n); +size_t fz_strlcat(char *dst, const char *src, size_t n); /* fz_dirname: extract the directory component from a path. */ -void fz_dirname(char *dir, const char *path, int dirsize); +void fz_dirname(char *dir, const char *path, size_t dirsize); /* fz_urldecode: decode url escapes. @@ -69,7 +69,7 @@ char *fz_urldecode(char *url); number will be inserted before the file suffix. If the template does not have a file suffix, the page number will be added to the end. */ -void fz_format_output_path(fz_context *ctx, char *path, int size, const char *fmt, int page); +void fz_format_output_path(fz_context *ctx, char *path, size_t size, const char *fmt, int page); /* fz_cleanname: rewrite path to the shortest string that names the same path. diff --git a/include/mupdf/fitz/xml.h b/include/mupdf/fitz/xml.h index 7e226f71..35608fcc 100644 --- a/include/mupdf/fitz/xml.h +++ b/include/mupdf/fitz/xml.h @@ -15,7 +15,7 @@ typedef struct fz_xml_s fz_xml; preserve_white: whether to keep or delete all-whitespace nodes. */ -fz_xml *fz_parse_xml(fz_context *ctx, unsigned char *buf, int len, int preserve_white); +fz_xml *fz_parse_xml(fz_context *ctx, unsigned char *buf, size_t len, int preserve_white); /* fz_xml_prev: Return previous sibling of XML node. diff --git a/include/mupdf/pdf/font.h b/include/mupdf/pdf/font.h index 52e5e5ca..d2421ab0 100644 --- a/include/mupdf/pdf/font.h +++ b/include/mupdf/pdf/font.h @@ -51,7 +51,7 @@ struct pdf_vmtx_s struct pdf_font_desc_s { fz_storable storable; - unsigned int size; + size_t size; fz_font *font; @@ -67,12 +67,12 @@ struct pdf_font_desc_s /* Encoding (CMap) */ pdf_cmap *encoding; pdf_cmap *to_ttf_cmap; - int cid_to_gid_len; + size_t cid_to_gid_len; unsigned short *cid_to_gid; /* ToUnicode */ pdf_cmap *to_unicode; - int cid_to_ucs_len; + size_t cid_to_ucs_len; unsigned short *cid_to_ucs; /* Metrics (given in the PDF file) */ @@ -116,8 +116,8 @@ void pdf_drop_font(fz_context *ctx, pdf_font_desc *font); void pdf_print_font(fz_context *ctx, fz_output *out, pdf_font_desc *fontdesc); -fz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned char *buf, int len, fz_rect *rect); -float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, unsigned char *buf, int len, float room, int *count); +fz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned char *buf, size_t len, fz_rect *rect); +float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, unsigned char *buf, size_t len, float room, size_t *count); void pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nestedDepth); diff --git a/include/mupdf/pdf/object.h b/include/mupdf/pdf/object.h index 346a2f1e..51bfa593 100644 --- a/include/mupdf/pdf/object.h +++ b/include/mupdf/pdf/object.h @@ -17,7 +17,7 @@ pdf_obj *pdf_new_int(fz_context *ctx, pdf_document *doc, int i); pdf_obj *pdf_new_int_offset(fz_context *ctx, pdf_document *doc, fz_off_t off); pdf_obj *pdf_new_real(fz_context *ctx, pdf_document *doc, float f); pdf_obj *pdf_new_name(fz_context *ctx, pdf_document *doc, const char *str); -pdf_obj *pdf_new_string(fz_context *ctx, pdf_document *doc, const char *str, int len); +pdf_obj *pdf_new_string(fz_context *ctx, pdf_document *doc, const char *str, size_t len); pdf_obj *pdf_new_indirect(fz_context *ctx, pdf_document *doc, int num, int gen); pdf_obj *pdf_new_array(fz_context *ctx, pdf_document *doc, int initialcap); pdf_obj *pdf_new_dict(fz_context *ctx, pdf_document *doc, int initialcap); diff --git a/include/mupdf/xps.h b/include/mupdf/xps.h index eaeb331b..1091faa6 100644 --- a/include/mupdf/xps.h +++ b/include/mupdf/xps.h @@ -68,7 +68,7 @@ typedef struct xps_part_s xps_part; struct xps_part_s { char *name; - int size; + size_t size; unsigned char *data; }; |