From cca044c42abc66a3632d93ab9855a4335761b193 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 30 Apr 2021 02:03:14 +0000 Subject: [PATCH] Use explicit return type var names instead of guessing --- gen_type_mapping.py | 2 -- genbindings.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/gen_type_mapping.py b/gen_type_mapping.py index ba29e0af..d9bcf976 100644 --- a/gen_type_mapping.py +++ b/gen_type_mapping.py @@ -32,8 +32,6 @@ class TypeMappingGenerator: else: arr_name = "ret" arr_len = ret_arr_len - if arr_name == "arg": - arr_name = "ret" if ty_info.c_ty == "int8_tArray": (set_pfx, set_sfx) = self.consts.set_native_arr_contents(arr_name + "_arr", arr_len, ty_info) ret_conv = ("int8_tArray " + arr_name + "_arr = " + self.consts.create_native_arr_call(arr_len, ty_info) + ";\n" + set_pfx, "") diff --git a/genbindings.py b/genbindings.py index fe0d6f74..11e65927 100755 --- a/genbindings.py +++ b/genbindings.py @@ -408,7 +408,7 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java: else: struct_meth = method_name.split("_")[0] - return_type_info = type_mapping_generator.map_type(method_return_type, True, ret_arr_len, False, False) + return_type_info = type_mapping_generator.map_type(method_return_type.strip() + " ret", True, ret_arr_len, False, False) argument_types = [] default_constructor_args = {} @@ -545,7 +545,7 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java: field_fns = [] for fn_docs, fn_line in trait_fn_lines: - ret_ty_info = type_mapping_generator.map_type(fn_line.group(2), True, None, False, False) + ret_ty_info = type_mapping_generator.map_type(fn_line.group(2).strip() + " ret", True, None, False, False) is_const = fn_line.group(4) is not None arg_tys = [] -- 2.39.5