summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-06-27 11:11:55 +0200
committerDamjan Marion <dmarion@me.com>2018-06-27 13:38:43 +0000
commitc5ee4fd4aa1f873e5448df3395a178b44e3d55f8 (patch)
treef166b1967ca83030deb7081e874843e2acaf8e57 /src
parentbbfa5fdf52911e5138dad31bc228ca3bc7ceb8a6 (diff)
jvpp: cleanup generation of swap functions for custom types
Change-Id: I2d06890ba25cfae9f96e820086f228286c807b42 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/vpp-api/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py
index 48566f6234b..a76aadf468c 100755
--- a/src/vpp-api/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py
@@ -42,28 +42,25 @@ def generate_type_handlers(model, logger):
def _generate_class(model, t, type_handlers):
ref_name = t.java_name_lower
- jni_identifiers = generate_j2c_identifiers(t, class_ref_name="%sClass" % ref_name, object_ref_name="_host")
- type_handlers.append(_TYPE_NET_TO_HOST_TEMPLATE.substitute(
+ type_handlers.append(_TYPE_HOST_TO_NET_TEMPLATE.substitute(
c_name=t.name,
json_filename=model.json_api_files,
json_definition=t.doc,
type_reference_name=ref_name,
class_FQN=t.jni_name,
- jni_identifiers=jni_identifiers,
+ jni_identifiers=generate_j2c_identifiers(t, class_ref_name="%sClass" % ref_name, object_ref_name="_host"),
type_swap=generate_j2c_swap(t, struct_ref_name="_net")
))
-
- type_handlers.append(_TYPE_HOST_TO_NET_TEMPLATE.substitute(
+ type_handlers.append(_TYPE_NET_TO_HOST_TEMPLATE.substitute(
c_name=t.name,
json_filename=model.json_api_files,
json_definition=t.doc,
type_reference_name=ref_name,
class_FQN=t.jni_name,
- jni_identifiers=jni_identifiers,
type_swap=generate_c2j_swap(t, object_ref_name="_host", struct_ref_name="_net")
))
-_TYPE_NET_TO_HOST_TEMPLATE = Template("""
+_TYPE_HOST_TO_NET_TEMPLATE = Template("""
/**
* Host to network byte order conversion for ${c_name} type.
* Generated based on $json_filename:
@@ -76,7 +73,7 @@ $jni_identifiers
$type_swap
}""")
-_TYPE_HOST_TO_NET_TEMPLATE = Template("""
+_TYPE_NET_TO_HOST_TEMPLATE = Template("""
/**
* Network to host byte order conversion for ${c_name} type.
* Generated based on $json_filename: