X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=csharp_strings.py;h=a73ee2035d310be2568fa48f71b94ab9994ea3e4;hb=HEAD;hp=1121f93413fc2975e1a398b9235d6f41d4dbb7f3;hpb=0a4ade7d14dddb7cf0fead9491e4ee165d784a31;p=ldk-java diff --git a/csharp_strings.py b/csharp_strings.py index 1121f934..3e5e247d 100644 --- a/csharp_strings.py +++ b/csharp_strings.py @@ -576,12 +576,12 @@ int CS_LDK_register_{fn_suffix}_invoker(invoker_{fn_suffix} invoker) {{ return "InternalUtils.getArrayLength(" + arr_name + ")" def get_java_arr_elem(self, elem_ty, arr_name, idx): - if elem_ty.c_ty == "int64_t" or elem_ty.c_ty == "uint64_t" or elem_ty.c_ty.endswith("Array") or elem_ty.c_ty == "uintptr_t": + if elem_ty.c_ty == "int64_t" or elem_ty.c_ty == "uint64_t": + return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")" + elif elem_ty.c_ty.endswith("Array") or elem_ty.c_ty == "uintptr_t" or elem_ty.rust_obj == "LDKStr": return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")" elif elem_ty.rust_obj == "LDKU5": return "InternalUtils.getU8ArrayElem(" + arr_name + ", " + idx + ")" - elif elem_ty.rust_obj == "LDKStr": - return "InternalUtils.getU32ArrayElem(" + arr_name + ", " + idx + ")" else: assert False @@ -1179,7 +1179,7 @@ public class {struct_name.replace("LDK","")} : CommonBase {{ out_opaque_struct_human = "" out_opaque_struct_human += self.hu_struct_file_prefix out_opaque_struct_human += "\n/**\n * " + struct_doc_comment.replace("\n", "\n * ") + "\n */\n" - hu_name = struct_name.replace("LDKC2Tuple", "TwoTuple").replace("LDKC3Tuple", "ThreeTuple").replace("LDK", "") + hu_name = struct_name.replace("LDKC2Tuple", "TwoTuple").replace("LDKC3Tuple", "ThreeTuple").replace("LDKC4Tuple", "FourTuple").replace("LDK", "") out_opaque_struct_human += ("public class " + hu_name + " : CommonBase") if struct_name.startswith("LDKLocked") or struct_name.startswith("LDKReadOnly"): out_opaque_struct_human += (", IDisposable")