projects
/
ldk-java
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d1f74c
)
[C#] Very marginally clean up get_java_arr_elem conditionals
author
Matt Corallo
<git@bluematt.me>
Wed, 13 Mar 2024 14:56:08 +0000
(14:56 +0000)
committer
Matt Corallo
<git@bluematt.me>
Wed, 13 Mar 2024 14:56:08 +0000
(14:56 +0000)
csharp_strings.py
patch
|
blob
|
history
diff --git
a/csharp_strings.py
b/csharp_strings.py
index e1c2708e82e32ebcce0ea8dabe509c012675397a..a73ee2035d310be2568fa48f71b94ab9994ea3e4 100644
(file)
--- 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):
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 + ")"
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.getU64ArrayElem(" + arr_name + ", " + idx + ")"
else:
assert False
else:
assert False