From 34e7772443f57f4fa561b4affb682329fb9f3bc4 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Mon, 30 May 2016 21:52:37 +0200 Subject: Fix u16 type handling in jvpp Change-Id: I6e5ed2562c65dde6c9f6f085c8b9d40f80684894 Signed-off-by: Marek Gradzki --- vpp-api/java/jvpp/gen/jvpp_c_gen.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'vpp-api/java/jvpp/gen') diff --git a/vpp-api/java/jvpp/gen/jvpp_c_gen.py b/vpp-api/java/jvpp/gen/jvpp_c_gen.py index c02c826fc49..476a768d9a0 100644 --- a/vpp-api/java/jvpp/gen/jvpp_c_gen.py +++ b/vpp-api/java/jvpp/gen/jvpp_c_gen.py @@ -116,7 +116,7 @@ vl_api_ip6_fib_counter_t_array_struct_setter_template = Template(""" // vl_api_ip6_fib_counter_t_array_field_setter_template FIXME""") struct_setter_templates = {'u8': u8_struct_setter_template, - 'u16': u32_struct_setter_template, + 'u16': u16_struct_setter_template, 'u32': u32_struct_setter_template, 'i32': u32_struct_setter_template, 'u64': u64_struct_setter_template, @@ -218,6 +218,10 @@ default_dto_field_setter_template = Template(""" (*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, mp->${c_name}); """) +u16_dto_field_setter_template = Template(""" + (*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, clib_net_to_host_u16(mp->${c_name})); +""") + u32_dto_field_setter_template = Template(""" (*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, clib_net_to_host_u32(mp->${c_name})); """) @@ -247,11 +251,11 @@ u64_array_dto_field_setter_template = Template(""" """) dto_field_setter_templates = {'u8': default_dto_field_setter_template, - 'u16': u32_dto_field_setter_template, + 'u16': u16_dto_field_setter_template, 'u32': u32_dto_field_setter_template, 'i32': u32_dto_field_setter_template, 'u64': u64_dto_field_setter_template, - 'f64': default_dto_field_setter_template, + 'f64': default_dto_field_setter_template, #fixme 'u64[]': u64_array_dto_field_setter_template, 'u8[]': u8_array_dto_field_setter_template } -- cgit 1.2.3-korg