diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/java/Android.mk | 1 | ||||
-rw-r--r-- | platform/java/mupdf_native.c | 4 | ||||
-rw-r--r-- | platform/x11/curl_stream.c | 14 | ||||
-rw-r--r-- | platform/x11/pdfapp.c | 8 | ||||
-rw-r--r-- | platform/x11/win_main.c | 4 |
5 files changed, 20 insertions, 11 deletions
diff --git a/platform/java/Android.mk b/platform/java/Android.mk index 465bd57b..1b880fac 100644 --- a/platform/java/Android.mk +++ b/platform/java/Android.mk @@ -53,6 +53,7 @@ LOCAL_C_INCLUDES := \ LOCAL_CFLAGS := \ -ffunction-sections -fdata-sections \ + -D_FILE_OFFSET_BITS=32 \ -DTOFU_NOTO -DTOFU_CJK \ -DAA_BITS=8 \ diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 94ac6a34..e6d3629d 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -15,6 +15,10 @@ #include "mupdf_native.h" /* javah generated prototypes */ +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> + #ifdef HAVE_ANDROID #include <android/log.h> #include <android/bitmap.h> diff --git a/platform/x11/curl_stream.c b/platform/x11/curl_stream.c index db5a1413..e70607d5 100644 --- a/platform/x11/curl_stream.c +++ b/platform/x11/curl_stream.c @@ -324,7 +324,7 @@ stream_next(fz_context *ctx, fz_stream *stream, size_t len) { curl_stream_state *state = (curl_stream_state *)stream->state; size_t len_read = 0; - fz_off_t read_point = stream->pos; + int64_t read_point = stream->pos; int block = read_point>>BLOCK_SHIFT; size_t left_over = (-read_point) & (BLOCK_SIZE-1); unsigned char *buf = state->public_buffer; @@ -336,7 +336,7 @@ stream_next(fz_context *ctx, fz_stream *stream, size_t len) len = sizeof(state->public_buffer); if (state->content_length == 0) - fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (A) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (A) (offset=%ld)", read_point); if (state->map == NULL) { @@ -345,7 +345,7 @@ stream_next(fz_context *ctx, fz_stream *stream, size_t len) if (read_point + len > state->current_fill_point) { stream->rp = stream->wp; - fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (B) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (B) (offset=%ld)", read_point); } memcpy(buf, state->buffer + read_point, len); stream->rp = buf; @@ -370,7 +370,7 @@ stream_next(fz_context *ctx, fz_stream *stream, size_t len) state->fill_point = block; unlock(state); stream->rp = stream->wp; - fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (C) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (C) (offset=%ld)", read_point); } block++; if (left_over > len) @@ -391,7 +391,7 @@ stream_next(fz_context *ctx, fz_stream *stream, size_t len) state->fill_point = block; unlock(state); stream->rp = stream->wp; - fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (D) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (D) (offset=%ld)", read_point); } block++; memcpy(buf, state->buffer + read_point, BLOCK_SIZE); @@ -410,7 +410,7 @@ stream_next(fz_context *ctx, fz_stream *stream, size_t len) state->fill_point = block; unlock(state); stream->rp = stream->wp; - fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (E) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (E) (offset=%ld)", read_point); } memcpy(buf, state->buffer + read_point, len); len_read += len; @@ -456,7 +456,7 @@ static curl_stream_state hack; static int hack_pos; static void -stream_seek(fz_context *ctx, fz_stream *stream, fz_off_t offset, int whence) +stream_seek(fz_context *ctx, fz_stream *stream, int64_t offset, int whence) { curl_stream_state *state = (curl_stream_state *)stream->state; diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index 3fffd4ef..a5c524b4 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -520,7 +520,7 @@ static int gen_tmp_file(char *buf, int len) for (i = 0; i < 10000; i++) { FILE *f; - snprintf(name, buf+len-name, "tmp%04d", i); + sprintf(name, "tmp%04d", i); f = fopen(buf, "r"); if (f == NULL) return 1; @@ -903,9 +903,9 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai len = MAX_TITLE-strlen(buf2); if (strlen(app->doctitle) > len) { - snprintf(buf, len-3, "%s", app->doctitle); - strcat(buf, "..."); - strcat(buf, buf2); + fz_strlcpy(buf, app->doctitle, len-3); + fz_strlcat(buf, "...", MAX_TITLE); + fz_strlcat(buf, buf2, MAX_TITLE); } else sprintf(buf, "%s%s", app->doctitle, buf2); diff --git a/platform/x11/win_main.c b/platform/x11/win_main.c index 67efdb9d..877f8c73 100644 --- a/platform/x11/win_main.c +++ b/platform/x11/win_main.c @@ -12,6 +12,10 @@ /* Include pdfapp.h *AFTER* the UNICODE defines */ #include "pdfapp.h" +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> + #ifndef WM_MOUSEWHEEL #define WM_MOUSEWHEEL 0x020A #endif |