summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-03-15 14:44:17 +0100
committerMichal Cmarada <mcmarada@cisco.com>2019-03-15 14:46:43 +0100
commit27bc4d16ee41341d56a91053a55c03abfd830730 (patch)
treef820cf53796048a51d2e714061c5f01d2f682d0f
parent585c798025dcde4b865718ba1e68c6a86dc99311 (diff)
fix string variable name
In case of strings if the field name contains name with underscore it wasn't converted to camelCase style. It was working for simple cases such as "cmd" but for more complex field names like "name_filter" the variable wasn't translated to "nameFiler" but remained unchanged. Change-Id: Ia53fdafd1cb53bcaba72e4d0433d71980d498e4c Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
-rwxr-xr-xjava/jvpp/gen/jvppgen/jni_impl_gen.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/jvpp/gen/jvppgen/jni_impl_gen.py b/java/jvpp/gen/jvppgen/jni_impl_gen.py
index e53e5de..c6fa9e1 100755
--- a/java/jvpp/gen/jvppgen/jni_impl_gen.py
+++ b/java/jvpp/gen/jvppgen/jni_impl_gen.py
@@ -16,7 +16,7 @@
from string import Template
from jni_common_gen import generate_j2c_identifiers, generate_j2c_swap
-from jvpp_model import is_dump, is_request, is_control_ping, is_control_ping_reply
+from jvpp_model import is_dump, is_request, is_control_ping, is_control_ping_reply, _underscore_to_camelcase_lower
def generate_jni_impl(model):
@@ -112,5 +112,5 @@ def _generate_msg_size(msg):
# FIXME(VPP-586): for proper nested structures support, we need generate functions computing type sizes
# and use it instead of sizeof
if field.type.name == "string":
- _size_components += " + 1 + jstr_length(env, %s) * sizeof(u8)" % field.name
+ _size_components += " + 1 + jstr_length(env, %s) * sizeof(u8)" % _underscore_to_camelcase_lower(field.name)
return msg_size + "".join(_size_components)