diff options
author | Robin Watts <robin.watts@artifex.com> | 2017-06-14 19:50:27 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-06-16 16:13:18 +0100 |
commit | 6c36b5ce05013fd336e318ad414edc5de0c2739c (patch) | |
tree | 3b3f1b038b36ddc2f74db27272bb8adf4392227e | |
parent | 691a6b2c26767186ee7e0e7d0813391f41ac0850 (diff) | |
download | mupdf-6c36b5ce05013fd336e318ad414edc5de0c2739c.tar.xz |
Fix MSVC build of mupdf_native.c
Usual "declaration not at top of block" thing.
Also, fix a warning; casting an int to a size_t then using the
size_t where an int was wanted seems odd.
-rw-r--r-- | platform/java/mupdf_native.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index a0a509bf..137a1c1a 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -299,8 +299,9 @@ static void fz_throw_java(fz_context *ctx, JNIEnv *env) jthrowable ex = (*env)->ExceptionOccurred(env); if (ex) { + jobject msg; (*env)->ExceptionClear(env); - jobject msg = (*env)->CallObjectMethod(env, ex, mid_Object_toString); + msg = (*env)->CallObjectMethod(env, ex, mid_Object_toString); if ((*env)->ExceptionCheck(env)) (*env)->ExceptionClear(env); else if (msg) @@ -6283,14 +6284,13 @@ FUN(PDFDocument_findPage)(JNIEnv *env, jobject self, jint jat) { fz_context *ctx = get_context(env); pdf_document *pdf = from_PDFDocument(env, self); - size_t at = (size_t) jat; pdf_obj *obj = NULL; if (!ctx || !pdf) return NULL; if (jat < 0 || jat >= pdf_count_pages(ctx, pdf)) { jni_throw_oob(env, "at is not a valid page"); return NULL; } fz_try(ctx) - obj = pdf_lookup_page_obj(ctx, pdf, at); + obj = pdf_lookup_page_obj(ctx, pdf, jat); fz_catch(ctx) { jni_rethrow(env, ctx); @@ -7899,7 +7899,7 @@ FUN(PDFObject_asByteName)(JNIEnv *env, jobject self) } len = strlen(str); - jbs = (*env)->NewByteArray(env, len); + jbs = (*env)->NewByteArray(env, (jsize)len); if (!jbs) return NULL; bs = (*env)->GetByteArrayElements(env, jbs, NULL); if (!bs) return NULL; |