refactor: reduce dependencies on libc

This commit is contained in:
dignifiedquire
2019-05-30 21:39:20 +02:00
committed by Lars-Magnus Skog
parent 518935a938
commit 95d4df6027
17 changed files with 80 additions and 167 deletions

View File

@@ -240,9 +240,8 @@ pub unsafe fn dc_block_contact(context: &Context, contact_id: uint32_t, new_bloc
pub unsafe fn dc_contact_new<'a>(context: &'a Context) -> *mut dc_contact_t<'a> {
let mut contact: *mut dc_contact_t;
contact = calloc(1, ::std::mem::size_of::<dc_contact_t>()) as *mut dc_contact_t;
if contact.is_null() {
exit(19i32);
}
assert!(!contact.is_null());
(*contact).magic = 0xc047ac7i32 as uint32_t;
(*contact).context = context;