summaryrefslogtreecommitdiff
path: root/source/gprf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-08-17 15:01:09 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-11-01 13:08:56 +0100
commitf595e889b91a674eb94db7ca4d832da54f5194cd (patch)
tree273b4a7cc465477e428d0c628a19a61301baaae0 /source/gprf
parent2910531c99e80bede06d2f1460459e8f6ce79961 (diff)
downloadmupdf-f595e889b91a674eb94db7ca4d832da54f5194cd.tar.xz
Use int64_t for public file API offsets.
Don't mess with conditional compilation with LARGEFILE -- always expose 64-bit file offsets in our public API.
Diffstat (limited to 'source/gprf')
-rw-r--r--source/gprf/gprf-doc.c14
-rw-r--r--source/gprf/gprf-skeleton.c2
2 files changed, 9 insertions, 7 deletions
diff --git a/source/gprf/gprf-doc.c b/source/gprf/gprf-doc.c
index 0b80223c..44e5d817 100644
--- a/source/gprf/gprf-doc.c
+++ b/source/gprf/gprf-doc.c
@@ -123,7 +123,7 @@ struct gprf_page_s
typedef struct fz_image_gprf_s
{
fz_image super;
- fz_off_t offset[FZ_MAX_SEPARATIONS+3+1]; /* + RGB + END */
+ int64_t offset[FZ_MAX_SEPARATIONS+3+1]; /* + RGB + END */
gprf_file *file;
fz_separations *separations;
} fz_image_gprf;
@@ -476,7 +476,7 @@ gprf_get_pixmap(fz_context *ctx, fz_image *image_, fz_irect *area, int w, int h,
}
static fz_image *
-fz_new_gprf_image(fz_context *ctx, gprf_page *page, int imagenum, fz_off_t offsets[], fz_off_t end)
+fz_new_gprf_image(fz_context *ctx, gprf_page *page, int imagenum, int64_t offsets[], int64_t end)
{
fz_image_gprf *image = fz_malloc_struct(ctx, fz_image_gprf);
int tile_x = imagenum % page->tile_width;
@@ -509,7 +509,7 @@ fz_new_gprf_image(fz_context *ctx, gprf_page *page, int imagenum, fz_off_t offse
image->super.yres = page->doc->res;
image->super.mask = NULL;
image->file = fz_keep_gprf_file(ctx, page->file);
- memcpy(image->offset, offsets, sizeof(fz_off_t) * (3+seps));
+ memcpy(image->offset, offsets, sizeof(int64_t) * (3+seps));
image->offset[seps+3] = end;
image->separations = fz_keep_separations(ctx, page->separations);
@@ -762,7 +762,7 @@ read_tiles(fz_context *ctx, gprf_page *page)
}
/* Seek to the image data */
- fz_seek(ctx, file, (fz_off_t)offset, SEEK_SET);
+ fz_seek(ctx, file, (int64_t)offset, SEEK_SET);
num_tiles = page->tile_width * page->tile_height;
page->tiles = fz_calloc(ctx, num_tiles, sizeof(fz_image *));
@@ -773,16 +773,16 @@ read_tiles(fz_context *ctx, gprf_page *page)
{
for (x = 0; x < page->tile_width; x++)
{
- fz_off_t offsets[FZ_MAX_SEPARATIONS + 3]; /* SEPARATIONS + RGB */
+ int64_t offsets[FZ_MAX_SEPARATIONS + 3]; /* SEPARATIONS + RGB */
int j;
for (j = 0; j < num_seps+3; j++)
{
- offsets[j] = (fz_off_t)off;
+ offsets[j] = (int64_t)off;
off = fz_read_int64_le(ctx, file);
}
- page->tiles[i] = fz_new_gprf_image(ctx, page, i, offsets, (fz_off_t)off);
+ page->tiles[i] = fz_new_gprf_image(ctx, page, i, offsets, (int64_t)off);
i++;
}
}
diff --git a/source/gprf/gprf-skeleton.c b/source/gprf/gprf-skeleton.c
index 1c9ec146..d4ad734c 100644
--- a/source/gprf/gprf-skeleton.c
+++ b/source/gprf/gprf-skeleton.c
@@ -1,5 +1,7 @@
#include "mupdf/fitz.h"
+#include <string.h>
+
void
fz_save_gproof(fz_context *ctx, const char *pdf_file, fz_document *doc, const char *filename, int res,
const char *print_profile, const char *display_profile)