From: Matt Corallo Date: Fri, 30 Apr 2021 02:03:14 +0000 (+0000) Subject: Use explicit return type var names instead of guessing X-Git-Tag: v0.0.98~1^2~21 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=cca044c42abc66a3632d93ab9855a4335761b193;p=ldk-java Use explicit return type var names instead of guessing --- 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 = []