Commit 16e082d4 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed const list in java wrapper

parent 9ee7b858
...@@ -259,6 +259,8 @@ class JavaTranslator(object): ...@@ -259,6 +259,8 @@ class JavaTranslator(object):
methodDict['hasNormalReturn'] = not methodDict['hasListReturn'] and not methodDict['hasStringReturn'] and not methodDict['hasByteArrayReturn'] methodDict['hasNormalReturn'] = not methodDict['hasListReturn'] and not methodDict['hasStringReturn'] and not methodDict['hasByteArrayReturn']
methodDict['name'] = 'Java_' + self.jni_package + className + 'Impl_' + _method.name.translate(self.nameTranslator) methodDict['name'] = 'Java_' + self.jni_package + className + 'Impl_' + _method.name.translate(self.nameTranslator)
methodDict['notStatic'] = not static methodDict['notStatic'] = not static
methodDict['isConstList'] = _method.returnType.isconst
methodDict['isNotConstList'] = not _method.returnType.isconst
if _method.name.to_c()[-1] == '2': if _method.name.to_c()[-1] == '2':
methodDict['name'] += "2" methodDict['name'] += "2"
......
...@@ -428,6 +428,7 @@ void Java_{{jniPackage}}{{className}}Impl_removeListener(JNIEnv* env, jobject th ...@@ -428,6 +428,7 @@ void Java_{{jniPackage}}{{className}}Impl_removeListener(JNIEnv* env, jobject th
break; break;
} }
} }
{{#isNotConstList}}bctbx_list_free(cbs_list);{{/isNotConstList}}
} }
{{/isMultiListener}} {{/isMultiListener}}
{{/interfaces}} {{/interfaces}}
...@@ -474,7 +475,7 @@ jobject Java_{{jni_package}}CoreImpl_getMediastreamerFactory(JNIEnv *env, jobjec ...@@ -474,7 +475,7 @@ jobject Java_{{jni_package}}CoreImpl_getMediastreamerFactory(JNIEnv *env, jobjec
{{/isObjList}} {{/isObjList}}
} }
{{/lists}}{{#hasListReturn}} {{/lists}}{{#hasListReturn}}
const bctbx_list_t *list = {{c_name}}({{#notStatic}}cptr{{/notStatic}}{{params_impl}}); {{#isConstList}}const {{/isConstList}}bctbx_list_t *list = {{c_name}}({{#notStatic}}cptr{{/notStatic}}{{params_impl}});
size_t count = bctbx_list_size(list); size_t count = bctbx_list_size(list);
{{#isRealObjectArray}} {{#isRealObjectArray}}
LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_factory_get_user_data(linphone_factory_get()); LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_factory_get_user_data(linphone_factory_get());
...@@ -493,6 +494,7 @@ jobject Java_{{jni_package}}CoreImpl_getMediastreamerFactory(JNIEnv *env, jobjec ...@@ -493,6 +494,7 @@ jobject Java_{{jni_package}}CoreImpl_getMediastreamerFactory(JNIEnv *env, jobjec
} }
list = bctbx_list_next(list); list = bctbx_list_next(list);
} }
{{#isNotConstList}}bctbx_list_free(list);{{/isNotConstList}}
{{/hasListReturn}}{{#hasByteArrayReturn}} {{/hasListReturn}}{{#hasByteArrayReturn}}
{{c_type_return}} jni_result = {{c_name}}({{#notStatic}}cptr{{/notStatic}}{{params_impl}}); {{c_type_return}} jni_result = {{c_name}}({{#notStatic}}cptr{{/notStatic}}{{params_impl}});
if (!jni_result) return NULL; if (!jni_result) return NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment