X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=java_strings.py;h=3a8ba6cb613047a728cb77a09abd7b5557664aba;hb=97e1121dc704985a3b4d6a4a4d4156cc7427bc8c;hp=8fcc3e5cf13cf6bcf6b59c1671a94f2d5710bee9;hpb=64bcaa6a2a2f05653c14b9cb8bb97ab2480eaaa5;p=ldk-java diff --git a/java_strings.py b/java_strings.py index 8fcc3e5c..3a8ba6cb 100644 --- a/java_strings.py +++ b/java_strings.py @@ -630,6 +630,8 @@ import javax.annotation.Nullable; return arr_name + " != null ? Arrays.stream(" + arr_name + ").mapToLong(" + conv_name + " -> " + elem_ty.from_hu_conv[0] + ").toArray() : null" elif elem_ty.java_ty == "long": return arr_name + " != null ? Arrays.stream(" + arr_name + ").map(" + conv_name + " -> " + elem_ty.from_hu_conv[0] + ").toArray() : null" + elif elem_ty.java_hu_ty == "UInt5": + return arr_name + " != null ? InternalUtils.convUInt5Array(" + arr_name + ") : null" else: return arr_name + " != null ? Arrays.stream(" + arr_name + ").map(" + conv_name + " -> " + elem_ty.from_hu_conv[0] + ").toArray(" + arr_ty.java_ty + "::new) : null" @@ -673,6 +675,8 @@ import javax.annotation.Nullable; # Do a bit of a dance to move any excess [] to the end conv += "[" + ty_info.subty.java_hu_ty.split("<")[0].split("[")[1] return conv + def cleanup_converted_native_array(self, ty_info, arr_name): + return None def primitive_arr_from_hu(self, mapped_ty, fixed_len, arr_name): if fixed_len is not None: @@ -878,7 +882,8 @@ import javax.annotation.Nullable; else: java_trait_constr = java_trait_constr + arg_info.arg_name - java_trait_constr = java_trait_constr + ");\n" + java_trait_constr += ");\n" + java_trait_constr += "\t\t\t\tReference.reachabilityFence(arg);\n" if fn_line.ret_ty_info.java_ty != "void": if fn_line.ret_ty_info.from_hu_conv is not None: java_trait_constr = java_trait_constr + "\t\t\t\t" + fn_line.ret_ty_info.java_ty + " result = " + fn_line.ret_ty_info.from_hu_conv[0] + ";\n"