mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
Move dc_array_get_ptr inside dc_array_t implementation
This commit is contained in:
@@ -51,6 +51,10 @@ impl dc_array_t {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_ptr(&self, index: size_t) -> *mut libc::c_void {
|
||||||
|
self.array[index] as *mut libc::c_void
|
||||||
|
}
|
||||||
|
|
||||||
pub fn is_empty(&self) -> bool {
|
pub fn is_empty(&self) -> bool {
|
||||||
self.array.is_empty()
|
self.array.is_empty()
|
||||||
}
|
}
|
||||||
@@ -126,9 +130,10 @@ pub unsafe fn dc_array_get_id(array: *const dc_array_t, index: size_t) -> uint32
|
|||||||
|
|
||||||
pub unsafe fn dc_array_get_ptr(array: *const dc_array_t, index: size_t) -> *mut libc::c_void {
|
pub unsafe fn dc_array_get_ptr(array: *const dc_array_t, index: size_t) -> *mut libc::c_void {
|
||||||
if array.is_null() || index >= (*array).len() {
|
if array.is_null() || index >= (*array).len() {
|
||||||
return 0 as *mut libc::c_void;
|
std::ptr::null_mut()
|
||||||
|
} else {
|
||||||
|
(*array).get_ptr(index)
|
||||||
}
|
}
|
||||||
(*array).array[index] as *mut libc::c_void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_latitude(array: *const dc_array_t, index: size_t) -> libc::c_double {
|
pub unsafe fn dc_array_get_latitude(array: *const dc_array_t, index: size_t) -> libc::c_double {
|
||||||
|
|||||||
Reference in New Issue
Block a user