@@ -291,7 +291,7 @@ def _do_map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, hold
291291 else :
292292 from_hu_conv = (ty_info .var_name + " == null ? 0 : " + ty_info .var_name + ".clone_ptr()" , "" )
293293 elif ty_info .passed_as_ptr :
294- opaque_arg_conv = opaque_arg_conv + "\n // Warning : we need a move here but no clone is available for " + ty_info .rust_obj
294+ opaque_arg_conv = opaque_arg_conv + "\n // WARNING : we need a move here but no clone is available for " + ty_info .rust_obj
295295 # TODO: Once we support features cloning (which just isn't in C yet), we can make this a compile error instead!
296296 from_hu_conv = (from_hu_conv [0 ], from_hu_conv [1 ] + ";\n " +
297297 "// Due to rust's strict-ownership memory model, in some cases we need to \" move\" \n " +
@@ -311,7 +311,7 @@ def _do_map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, hold
311311 if not holds_ref and ty_info .is_ptr and (ty_info .rust_obj .replace ("LDK" , "" ) + "_clone" ) in self .clone_fns : # is_ptr, not holds_ref implies passing a pointed-to value to java, which needs copied
312312 opaque_ret_conv_suf += indent + ty_info .var_name + "_var = " + ty_info .rust_obj .replace ("LDK" , "" ) + "_clone(" + ty_info .var_name + ");\n "
313313 elif not holds_ref and ty_info .is_ptr :
314- opaque_ret_conv_suf += indent + "// Warning : we may need a move here but no clone is available for " + ty_info .rust_obj + "\n "
314+ opaque_ret_conv_suf += indent + "// WARNING : we may need a move here but no clone is available for " + ty_info .rust_obj + "\n "
315315
316316 opaque_ret_conv_suf += indent + "CHECK((((uintptr_t)" + ty_info .var_name + "_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.\n "
317317 opaque_ret_conv_suf += indent + "CHECK((((uintptr_t)&" + ty_info .var_name + "_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.\n "
@@ -367,7 +367,7 @@ def _do_map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, hold
367367 if (ty_info .rust_obj .replace ("LDK" , "" ) + "_clone" ) in self .clone_fns :
368368 ret_conv = (ret_conv [0 ] + ty_info .rust_obj .replace ("LDK" , "" ) + "_clone(&" , ");" )
369369 else :
370- ret_conv = (ret_conv [0 ], ";\n // Warning : We likely need to clone here, but no clone is available, so we just do it for Java instances" )
370+ ret_conv = (ret_conv [0 ], ";\n // WARNING : We likely need to clone here, but no clone is available, so we just do it for Java instances" )
371371 ret_conv = (ret_conv [0 ], ret_conv [1 ] + "" + self .consts .trait_struct_inc_refcnt (ty_info ).replace (ty_info .var_name + "_conv" , "(*" + ty_info .var_name + "_ret)" ))
372372 if not is_free :
373373 needs_full_clone = not is_free and (not ty_info .is_ptr and not holds_ref or ty_info .requires_clone == True ) and ty_info .requires_clone != False
@@ -384,7 +384,7 @@ def _do_map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, hold
384384 else :
385385 base_conv = base_conv + self .consts .trait_struct_inc_refcnt (ty_info )
386386 if needs_full_clone :
387- base_conv = base_conv + "// Warning : we may need a move here but no clone is available for " + ty_info .rust_obj + "\n "
387+ base_conv = base_conv + "// WARNING : we may need a move here but no clone is available for " + ty_info .rust_obj + "\n "
388388 else :
389389 base_conv = base_conv + "\n " + "FREE((void*)" + ty_info .var_name + ");"
390390 if from_hu_conv is None :
@@ -410,7 +410,7 @@ def _do_map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, hold
410410 from_hu_conv = (ty_info .var_name + " == null ? 0 : " + ty_info .var_name + ".clone_ptr()" , "" )
411411 base_conv += "\n " + "FREE((void*)" + ty_info .var_name + ");"
412412 elif needs_full_clone :
413- base_conv = base_conv + "\n // Warning : we may need a move here but no clone is available for " + ty_info .rust_obj
413+ base_conv = base_conv + "\n // WARNING : we may need a move here but no clone is available for " + ty_info .rust_obj
414414 if not needs_full_clone and ty_info .rust_obj != "LDKu8slice" and (not holds_ref or is_free ):
415415 # Don't bother free'ing slices passed in - Rust doesn't auto-free the
416416 # underlying unlike Vecs, and it gives Java more freedom.
@@ -465,7 +465,7 @@ def _do_map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, hold
465465 # If we're trying to return a ref, we have to clone.
466466 if (ty_info .rust_obj .replace ("LDK" , "" ) + "_clone" ) not in self .clone_fns :
467467 ret_conv = (ty_info .rust_obj + "* " + ty_info .var_name + "_conv = &" , "" )
468- ret_conv = (ret_conv [0 ], ";\n // Warning : we really need to clone here, but no clone is available for " + ty_info .rust_obj )
468+ ret_conv = (ret_conv [0 ], ";\n // WARNING : we really need to clone here, but no clone is available for " + ty_info .rust_obj )
469469 ret_conv_name += " | 1"
470470 else :
471471 ret_conv = (ty_info .rust_obj + "* " + ty_info .var_name + "_conv = MALLOC(sizeof(" + ty_info .rust_obj + "), \" " + ty_info .rust_obj + "\" );\n *" + ty_info .var_name + "_conv = " , ";" )
@@ -506,7 +506,7 @@ def _do_map_type_with_info(self, ty_info, print_void, ret_arr_len, is_free, hold
506506 elif ty_info .is_ptr :
507507 assert (not is_free )
508508 if ty_info .rust_obj in self .complex_enums :
509- ret_conv = ("uintptr_t ret_" + ty_info .var_name + " = (uintptr_t)" , " | 1; // Warning : We should clone here!" )
509+ ret_conv = ("uintptr_t ret_" + ty_info .var_name + " = (uintptr_t)" , " | 1; // WARNING : We should clone here!" )
510510 from_hu_sfx = self .consts .add_ref ("this" , ty_info .var_name )
511511 if ty_info .rust_obj .replace ("LDK" , "" ) + "_clone" in self .clone_fns :
512512 ret_conv_pfx = ty_info .rust_obj + " *ret_" + ty_info .var_name + " = MALLOC(sizeof(" + ty_info .rust_obj + "), \" " + ty_info .rust_obj + " ret conversion\" );\n "
0 commit comments