From 0d9d926131c87424458e3d30a8fe781706ae6bd0 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 4 Oct 2013 19:53:19 +0000 Subject: [PATCH] fixes in the Java binding after the refactoring of GuString --- src/runtime/java/jpgf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/java/jpgf.c b/src/runtime/java/jpgf.c index b31f52fd5..6bc83ed9a 100644 --- a/src/runtime/java/jpgf.c +++ b/src/runtime/java/jpgf.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -34,9 +35,9 @@ gu2j_string(JNIEnv *env, GuString s) { static GuString j2gu_string(JNIEnv *env, jstring s, GuPool* pool) { GuString str = (*env)->GetStringUTFChars(env, s, 0); - str = gu_string_copy(str, pool); + GuString copy = gu_string_copy(str, pool); (*env)->ReleaseStringUTFChars(env, s, str); - return str; + return copy; } static void* @@ -217,7 +218,7 @@ typedef struct { static void pgf_collect_langs(GuMapItor* fn, const void* key, void* value, GuExn* err) { - PgfCId name = *((PgfCId*) key); + PgfCId name = (PgfCId) key; PgfConcr* concr = *((PgfConcr**) value); JPGFClosure* clo = (JPGFClosure*) fn;