Skip to content

Commit bd8e3f0

Browse files
committed
[C#] Support u32 arrays
1 parent 94ef97c commit bd8e3f0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

c_sharp/src/org/ldk/util/InternalUtils.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ public static short[] decodeUint16Array(long arrptr) {
135135
bindings.free_buffer(arrptr);
136136
return res;
137137
}
138+
public static int[] decodeUint32Array(long arrptr) {
139+
int len = getArrayLength(arrptr);
140+
int[] res = new int[len];
141+
for (int i = 0; i < len; i++)
142+
res[i] = getU32ArrayElem(arrptr, i);
143+
bindings.free_buffer(arrptr);
144+
return res;
145+
}
138146
public static long[] decodeUint64Array(long arrptr) {
139147
int len = getArrayLength(arrptr);
140148
long[] res = new long[len];

csharp_strings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ def primitive_arr_to_hu(self, arr_ty, fixed_len, arr_name, conv_name):
673673
return "byte[] " + conv_name + " = InternalUtils.decodeUint8Array(" + arr_name + ");"
674674
elif mapped_ty.c_ty == "uint16_t" or mapped_ty.c_ty == "int16_t":
675675
return "short[] " + conv_name + " = InternalUtils.decodeUint16Array(" + arr_name + ");"
676+
elif mapped_ty.c_ty == "uint32_t" or mapped_ty.c_ty == "int32_t":
677+
return "int[] " + conv_name + " = InternalUtils.decodeUint32Array(" + arr_name + ");"
676678
elif mapped_ty.c_ty == "uint64_t" or mapped_ty.c_ty == "int64_t":
677679
return "long[] " + conv_name + " = InternalUtils.decodeUint64Array(" + arr_name + ");"
678680
else:

0 commit comments

Comments
 (0)