summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/jvpp_gen.py
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-05-24 13:32:26 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-05-24 15:44:28 +0000
commitc4cb44c05d121da2e0f0ccd39d5e1bf470731a85 (patch)
tree09fcf64e9fb23053baa775b23ec4e33d2a97cebb /vpp-api/java/jvpp/gen/jvpp_gen.py
parent4a71314e0bee9f0fc236190a2a6df957adef67f6 (diff)
VPP-86: fix array copy in generated JNI code
Change-Id: Ic67b3c0623d98c5ee3f1ffa1e1bd9cfb96b233bd Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp/gen/jvpp_gen.py')
-rwxr-xr-xvpp-api/java/jvpp/gen/jvpp_gen.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_gen.py b/vpp-api/java/jvpp/gen/jvpp_gen.py
index 931141e884a..e2ff2adcf14 100755
--- a/vpp-api/java/jvpp/gen/jvpp_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_gen.py
@@ -72,16 +72,19 @@ def get_args(t, filter):
def get_types(t, filter):
types_list = []
c_types_list = []
+ lengths_list = []
for i in t:
if not filter(i[1]):
continue
if len(i) is 3: # array type
types_list.append(vpp_2_jni_type_mapping[i[0]] + 'Array')
c_types_list.append(i[0] + '[]')
+ lengths_list.append(i[2])
else: # primitive type
types_list.append(vpp_2_jni_type_mapping[i[0]])
c_types_list.append(i[0])
- return types_list, c_types_list
+ lengths_list.append(0)
+ return types_list, c_types_list, lengths_list
def get_definitions():
@@ -96,18 +99,18 @@ def get_definitions():
# For replies include all the arguments except message_id
if util.is_reply(java_name):
- types, c_types = get_types(a[1:], is_response_field)
+ types, c_types, lengths = get_types(a[1:], is_response_field)
func_name[a[0]] = dict(
[('name', a[0]), ('java_name', java_name),
('args', get_args(a[1:], is_response_field)), ('full_args', get_args(a[1:], lambda x: True)),
- ('types', types), ('c_types', c_types)])
+ ('types', types), ('c_types', c_types), ('lengths', lengths)])
# For requests skip message_id, client_id and context
else:
- types, c_types = get_types(a[1:], is_request_field)
+ types, c_types, lengths = get_types(a[1:], is_request_field)
func_name[a[0]] = dict(
[('name', a[0]), ('java_name', java_name),
('args', get_args(a[1:], is_request_field)), ('full_args', get_args(a[1:], lambda x: True)),
- ('types', types), ('c_types', c_types)])
+ ('types', types), ('c_types', c_types), ('lengths', lengths)])
# Indexed by name
func_list.append(func_name[a[0]])