summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-07 12:22:21 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-08 20:06:10 +0100
commita5f105a2acb853f3bd7a71cb5c4c896dbcbb7480 (patch)
tree9418dea9d9ecfa069a5ed81d34ad837f00e22ad1
parentbe56635e063e84848389c4dd99990f78c35b6519 (diff)
downloadmupdf-a5f105a2acb853f3bd7a71cb5c4c896dbcbb7480.tar.xz
Fix android warnings.
-rw-r--r--Makefile2
-rw-r--r--include/mupdf/pdf/field.h1
-rw-r--r--platform/android/viewer/jni/Core.mk2
-rw-r--r--platform/android/viewer/jni/mupdf.c8
4 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index c85f7f5e..f36c3778 100644
--- a/Makefile
+++ b/Makefile
@@ -416,7 +416,7 @@ release:
debug:
$(MAKE) build=debug
-android:
+android: generate
$(MAKE) -C platform/android/viewer
.PHONY: all clean nuke install third libs apps generate
diff --git a/include/mupdf/pdf/field.h b/include/mupdf/pdf/field.h
index b0fd834b..baf650f4 100644
--- a/include/mupdf/pdf/field.h
+++ b/include/mupdf/pdf/field.h
@@ -51,5 +51,6 @@ char *pdf_field_name(fz_context *ctx, pdf_document *doc, pdf_obj *field);
void pdf_field_set_display(fz_context *ctx, pdf_document *doc, pdf_obj *field, int d);
pdf_obj *pdf_lookup_field(fz_context *ctx, pdf_obj *form, char *name);
void pdf_field_reset(fz_context *ctx, pdf_document *doc, pdf_obj *field);
+int pdf_signatures_supported(fz_context *ctx);
#endif
diff --git a/platform/android/viewer/jni/Core.mk b/platform/android/viewer/jni/Core.mk
index 4f9a3136..ca35e2a7 100644
--- a/platform/android/viewer/jni/Core.mk
+++ b/platform/android/viewer/jni/Core.mk
@@ -11,7 +11,7 @@ include $(CLEAR_VARS)
MY_ROOT := ../../..
-LOCAL_CFLAGS += -Wall -Wno-maybe-uninitialized
+LOCAL_CFLAGS += -Wall -Wno-uninitialized
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DARCH_ARM -DARCH_THUMB -DARCH_ARM_CAN_LOAD_UNALIGNED
diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c
index aa14a8f6..895f6912 100644
--- a/platform/android/viewer/jni/mupdf.c
+++ b/platform/android/viewer/jni/mupdf.c
@@ -368,7 +368,7 @@ JNI_FN(MuPDFCore_openFile)(JNIEnv * env, jobject thiz, jstring jfilename)
typedef struct buffer_state_s
{
globals *globals;
- char buffer[4096];
+ jbyte buffer[4096];
}
buffer_state;
@@ -391,7 +391,7 @@ static int bufferStreamNext(fz_context *ctx, fz_stream *stream, size_t max)
(*env)->GetByteArrayRegion(env, array, stream->pos, len, bs->buffer);
(*env)->DeleteLocalRef(env, array);
- stream->rp = bs->buffer;
+ stream->rp = (unsigned char *)bs->buffer;
stream->wp = stream->rp + len;
stream->pos += len;
if (len == 0)
@@ -1530,7 +1530,7 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz)
bArray = (*env)->NewByteArray(env, buf->len);
if (bArray == NULL)
fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to make byteArray");
- (*env)->SetByteArrayRegion(env, bArray, 0, buf->len, buf->data);
+ (*env)->SetByteArrayRegion(env, bArray, 0, buf->len, (const jbyte *)buf->data);
}
fz_always(ctx)
@@ -2386,7 +2386,7 @@ JNI_FN(MuPDFCore_getFocusedWidgetSignatureState)(JNIEnv * env, jobject thiz)
if (focus == NULL)
return Signature_NoSupport;
- if (!pdf_signatures_supported())
+ if (!pdf_signatures_supported(ctx))
return Signature_NoSupport;
return pdf_dict_get(ctx, ((pdf_annot *)focus)->obj, PDF_NAME_V) ? Signature_Signed : Signature_Unsigned;