Move some unsafe dc_array_* functions to FFI

This commit is contained in:
Alexander Krotov
2019-08-15 20:32:28 +03:00
parent 37622af55a
commit fadcd43fee
2 changed files with 7 additions and 42 deletions

View File

@@ -1094,7 +1094,7 @@ pub unsafe extern "C" fn dc_array_get_latitude(
) -> libc::c_double {
assert!(!array.is_null());
dc_array::dc_array_get_latitude(array, index)
(*array).get_latitude(index)
}
#[no_mangle]
pub unsafe extern "C" fn dc_array_get_longitude(
@@ -1103,7 +1103,7 @@ pub unsafe extern "C" fn dc_array_get_longitude(
) -> libc::c_double {
assert!(!array.is_null());
dc_array::dc_array_get_longitude(array, index)
(*array).get_longitude(index)
}
#[no_mangle]
pub unsafe extern "C" fn dc_array_get_accuracy(
@@ -1112,7 +1112,7 @@ pub unsafe extern "C" fn dc_array_get_accuracy(
) -> libc::c_double {
assert!(!array.is_null());
dc_array::dc_array_get_accuracy(array, index)
(*array).get_accuracy(index)
}
#[no_mangle]
pub unsafe extern "C" fn dc_array_get_timestamp(
@@ -1121,7 +1121,7 @@ pub unsafe extern "C" fn dc_array_get_timestamp(
) -> i64 {
assert!(!array.is_null());
dc_array::dc_array_get_timestamp(array, index)
(*array).get_timestamp(index)
}
#[no_mangle]
pub unsafe extern "C" fn dc_array_get_chat_id(
@@ -1130,7 +1130,7 @@ pub unsafe extern "C" fn dc_array_get_chat_id(
) -> libc::c_uint {
assert!(!array.is_null());
dc_array::dc_array_get_chat_id(array, index)
(*array).get_chat_id(index)
}
#[no_mangle]
pub unsafe extern "C" fn dc_array_get_contact_id(
@@ -1139,7 +1139,7 @@ pub unsafe extern "C" fn dc_array_get_contact_id(
) -> libc::c_uint {
assert!(!array.is_null());
dc_array::dc_array_get_contact_id(array, index)
(*array).get_contact_id(index)
}
#[no_mangle]
pub unsafe extern "C" fn dc_array_get_msg_id(
@@ -1148,7 +1148,7 @@ pub unsafe extern "C" fn dc_array_get_msg_id(
) -> libc::c_uint {
assert!(!array.is_null());
dc_array::dc_array_get_msg_id(array, index)
(*array).get_msg_id(index)
}
#[no_mangle]
pub unsafe extern "C" fn dc_array_get_marker(

View File

@@ -159,41 +159,6 @@ pub unsafe fn dc_array_get_id(array: *const dc_array_t, index: size_t) -> uint32
(*array).get_id(index)
}
pub unsafe fn dc_array_get_latitude(array: *const dc_array_t, index: size_t) -> libc::c_double {
assert!(!array.is_null());
(*array).get_latitude(index)
}
pub unsafe fn dc_array_get_longitude(array: *const dc_array_t, index: size_t) -> libc::c_double {
assert!(!array.is_null());
(*array).get_longitude(index)
}
pub unsafe fn dc_array_get_accuracy(array: *const dc_array_t, index: size_t) -> libc::c_double {
assert!(!array.is_null());
(*array).get_accuracy(index)
}
pub unsafe fn dc_array_get_timestamp(array: *const dc_array_t, index: size_t) -> i64 {
assert!(!array.is_null());
(*array).get_timestamp(index)
}
pub unsafe fn dc_array_get_chat_id(array: *const dc_array_t, index: size_t) -> uint32_t {
assert!(!array.is_null());
(*array).get_chat_id(index)
}
pub unsafe fn dc_array_get_contact_id(array: *const dc_array_t, index: size_t) -> uint32_t {
assert!(!array.is_null());
(*array).get_contact_id(index)
}
pub unsafe fn dc_array_get_msg_id(array: *const dc_array_t, index: size_t) -> uint32_t {
assert!(!array.is_null());
(*array).get_msg_id(index)
}
pub unsafe fn dc_array_get_marker(array: *const dc_array_t, index: size_t) -> *mut libc::c_char {
assert!(!array.is_null());