From aceac3b97e342defe03ad753b430c43b205c29ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20Makovi=C4=8Dka?= Date: Sat, 12 May 2012 18:15:11 +0200 Subject: [PATCH] use jlong to store pointer needed for 64bit build --- DataExtractionOSM/src/net/osmand/NativeLibrary.java | 10 +++++----- .../net/osmand/plus/render/NativeOsmandLibrary.java | 2 +- Osmand-kernel/osmand/src/java_wrap.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DataExtractionOSM/src/net/osmand/NativeLibrary.java b/DataExtractionOSM/src/net/osmand/NativeLibrary.java index cc320f492a..6467e098cd 100644 --- a/DataExtractionOSM/src/net/osmand/NativeLibrary.java +++ b/DataExtractionOSM/src/net/osmand/NativeLibrary.java @@ -17,8 +17,8 @@ public class NativeLibrary { public static class NativeSearchResult { - public int nativeHandler; - private NativeSearchResult(int nativeHandler) { + public long nativeHandler; + private NativeSearchResult(long nativeHandler) { this.nativeHandler = nativeHandler; } @@ -57,7 +57,7 @@ public class NativeLibrary { } - protected static native void deleteSearchResult(int searchResultHandle); + protected static native void deleteSearchResult(long searchResultHandle); protected static native boolean initBinaryMapFile(String filePath); @@ -66,10 +66,10 @@ public class NativeLibrary { protected static native void initRenderingRulesStorage(RenderingRulesStorage storage); - protected static native RenderingGenerationResult generateRenderingIndirect(RenderingContext rc, int searchResultHandler, + protected static native RenderingGenerationResult generateRenderingIndirect(RenderingContext rc, long searchResultHandler, boolean isTransparent, RenderingRuleSearchRequest render, boolean encodePng); - protected static native int searchNativeObjectsForRendering(int sleft, int sright, int stop, int sbottom, int zoom, + protected static native long searchNativeObjectsForRendering(int sleft, int sright, int stop, int sbottom, int zoom, RenderingRuleSearchRequest request, boolean skipDuplicates, Object objectWithInterruptedField, String msgIfNothingFound); } diff --git a/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java b/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java index 8ef4a04b7d..06e92ce9f1 100644 --- a/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java +++ b/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java @@ -95,7 +95,7 @@ public class NativeOsmandLibrary extends NativeLibrary { } - private static native RenderingGenerationResult generateRenderingDirect(RenderingContext rc, int searchResultHandler, + private static native RenderingGenerationResult generateRenderingDirect(RenderingContext rc, long searchResultHandler, Bitmap bitmap, RenderingRuleSearchRequest render); public static native int getCpuCount(); diff --git a/Osmand-kernel/osmand/src/java_wrap.cpp b/Osmand-kernel/osmand/src/java_wrap.cpp index 37ccb8c15b..42f2359b41 100644 --- a/Osmand-kernel/osmand/src/java_wrap.cpp +++ b/Osmand-kernel/osmand/src/java_wrap.cpp @@ -60,7 +60,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) } extern "C" JNIEXPORT void JNICALL Java_net_osmand_NativeLibrary_deleteSearchResult(JNIEnv* ienv, - jobject obj, jint searchResult) { + jobject obj, jlong searchResult) { ResultPublisher* result = (ResultPublisher*) searchResult; if(result != NULL){ delete result; @@ -119,7 +119,7 @@ RenderingRuleSearchRequest* initSearchRequest(JNIEnv* env, jobject renderingRule } -extern "C" JNIEXPORT jint JNICALL Java_net_osmand_NativeLibrary_searchNativeObjectsForRendering(JNIEnv* ienv, +extern "C" JNIEXPORT jlong JNICALL Java_net_osmand_NativeLibrary_searchNativeObjectsForRendering(JNIEnv* ienv, jobject obj, jint sleft, jint sright, jint stop, jint sbottom, jint zoom, jobject renderingRuleSearchRequest, bool skipDuplicates, jobject objInterrupted, jstring msgNothingFound) { RenderingRuleSearchRequest* req = initSearchRequest(ienv, renderingRuleSearchRequest); @@ -137,7 +137,7 @@ extern "C" JNIEXPORT jint JNICALL Java_net_osmand_NativeLibrary_searchNativeObje ResultPublisher* res = searchObjectsForRendering(&q, skipDuplicates, getString(ienv, msgNothingFound)); delete req; - return (jint) j; + return (jlong) j; } @@ -148,7 +148,7 @@ extern "C" JNIEXPORT jint JNICALL Java_net_osmand_NativeLibrary_searchNativeObje #include extern "C" JNIEXPORT jobject JNICALL Java_net_osmand_plus_render_NativeOsmandLibrary_generateRenderingDirect( JNIEnv* ienv, jobject obj, - jobject renderingContext, jint searchResult, jobject targetBitmap, jobject renderingRuleSearchRequest) { + jobject renderingContext, jlong searchResult, jobject targetBitmap, jobject renderingRuleSearchRequest) { // libJniGraphics interface typedef int (*PTR_AndroidBitmap_getInfo)(JNIEnv*, jobject, AndroidBitmapInfo*); @@ -266,7 +266,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_net_osmand_plus_render_NativeOsmandLib void* bitmapData = NULL; size_t bitmapDataSize = 0; extern "C" JNIEXPORT jobject JNICALL Java_net_osmand_NativeLibrary_generateRenderingIndirect( JNIEnv* ienv, - jobject obj, jobject renderingContext, jint searchResult, jboolean isTransparent, + jobject obj, jobject renderingContext, jlong searchResult, jboolean isTransparent, jobject renderingRuleSearchRequest, jboolean encodePNG) { JNIRenderingContext rc;