Remove dead code

This commit is contained in:
Dmitry Bogatov
2019-08-16 04:19:58 +00:00
parent ea661896a1
commit 7c7a1b64df
7 changed files with 8 additions and 21 deletions

View File

@@ -193,6 +193,7 @@ pub unsafe fn dc_null_terminate(
out
}
#[cfg(test)]
unsafe fn dc_binary_to_uc_hex(buf: *const uint8_t, bytes: size_t) -> *mut libc::c_char {
if buf.is_null() || bytes == 0 {
return std::ptr::null_mut();
@@ -225,10 +226,6 @@ pub unsafe fn dc_remove_cr_chars(buf: *mut libc::c_char) {
*p2 = 0 as libc::c_char;
}
unsafe fn dc_unify_lineends(buf: *mut libc::c_char) {
dc_remove_cr_chars(buf);
}
/* replace bad UTF-8 characters by sequences of `_` (to avoid problems in filenames, we do not use eg. `?`) the function is useful if strings are unexpectingly encoded eg. as ISO-8859-1 */
#[allow(non_snake_case)]
pub unsafe fn dc_replace_bad_utf8_chars(buf: *mut libc::c_char) {
@@ -295,6 +292,7 @@ pub unsafe fn dc_replace_bad_utf8_chars(buf: *mut libc::c_char) {
}
}
#[cfg(test)]
unsafe fn dc_utf8_strlen(s: *const libc::c_char) -> size_t {
if s.is_null() {
return 0;
@@ -413,6 +411,7 @@ pub unsafe fn dc_free_splitted_lines(lines: Vec<*mut libc::c_char>) {
}
/* insert a break every n characters, the return must be free()'d */
#[cfg(test)]
unsafe fn dc_insert_breaks(
in_0: *const libc::c_char,
break_every: libc::c_int,