bridge: Remove bridge_fn_buffer

At this point, the only special behavior of bridge_fn_buffer is to
support multiple return values for the C bridge (a pointer/length
pair), and that doesn't pull its weight. Remove it in favor of a plain
bridge_fn.

This did reveal that Username_Hash was using bridge_fn_buffer and now
produces a fixed-size array, imported into Swift as a tuple, so this
commit also factors out a new helper invokeFnReturningFixedLengthArray.
This commit is contained in:
Jordan Rose
2023-02-02 18:10:55 -08:00
parent 9822bb3b64
commit f3e0f61667
48 changed files with 260 additions and 335 deletions

View File

@@ -149,8 +149,7 @@ pub unsafe extern "C" fn signal_identitykeypair_deserialize(
#[no_mangle]
pub unsafe extern "C" fn signal_sealed_session_cipher_decrypt(
out: *mut *const c_uchar,
out_len: *mut size_t,
out: *mut OwnedBufferOf<c_uchar>,
sender_e164: *mut *const c_char,
sender_uuid: *mut *const c_char,
sender_device_id: *mut u32,
@@ -198,6 +197,6 @@ pub unsafe extern "C" fn signal_sealed_session_cipher_decrypt(
write_optional_cstr_to(sender_e164, Ok(decrypted.sender_e164))?;
write_cstr_to(sender_uuid, Ok(decrypted.sender_uuid))?;
write_result_to(sender_device_id, u32::from(decrypted.device_id))?;
write_bytearray_to(out, out_len, Some(decrypted.message))
write_result_to(out, decrypted.message)
})
}