mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Improve indentation in CEF strings.
This commit is contained in:
parent
893fc18c71
commit
577407fe68
1 changed files with 32 additions and 32 deletions
|
@ -89,19 +89,19 @@ pub extern "C" fn cef_string_utf8_set(src: *const u8, src_len: size_t, output: *
|
||||||
unsafe {
|
unsafe {
|
||||||
if copy != 0 {
|
if copy != 0 {
|
||||||
if !src.is_null() && src_len > 0 {
|
if !src.is_null() && src_len > 0 {
|
||||||
(*output).str = libc::calloc(1, src_len + 1) as *mut u8;
|
(*output).str = libc::calloc(1, src_len + 1) as *mut u8;
|
||||||
if (*output).str.is_null() {
|
if (*output).str.is_null() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr::copy(src, (*output).str, src_len as usize);
|
ptr::copy(src, (*output).str, src_len as usize);
|
||||||
(*output).length = src_len;
|
(*output).length = src_len;
|
||||||
(*output).dtor = Some(string_utf8_dtor as extern "C" fn(*mut u8));
|
(*output).dtor = Some(string_utf8_dtor as extern "C" fn(*mut u8));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(*output).str = src as *mut _;
|
(*output).str = src as *mut _;
|
||||||
(*output).length = src_len;
|
(*output).length = src_len;
|
||||||
(*output).dtor = None;
|
(*output).dtor = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -169,20 +169,20 @@ pub extern "C" fn cef_string_utf16_set(src: *const c_ushort, src_len: size_t, ou
|
||||||
unsafe {
|
unsafe {
|
||||||
if copy != 0 {
|
if copy != 0 {
|
||||||
if !src.is_null() && src_len > 0 {
|
if !src.is_null() && src_len > 0 {
|
||||||
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<c_ushort>() as u64) as
|
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<c_ushort>() as u64) as
|
||||||
*mut u16;
|
*mut u16;
|
||||||
if (*output).str.is_null() {
|
if (*output).str.is_null() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr::copy(src, (*output).str, src_len as usize);
|
ptr::copy(src, (*output).str, src_len as usize);
|
||||||
(*output).length = src_len;
|
(*output).length = src_len;
|
||||||
(*output).dtor = Some(string_utf16_dtor as extern "C" fn(*mut c_ushort));
|
(*output).dtor = Some(string_utf16_dtor as extern "C" fn(*mut c_ushort));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(*output).str = src as *mut _;
|
(*output).str = src as *mut _;
|
||||||
(*output).length = src_len;
|
(*output).length = src_len;
|
||||||
(*output).dtor = None;
|
(*output).dtor = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -227,20 +227,20 @@ pub extern "C" fn cef_string_wide_set(src: *const wchar_t, src_len: size_t, outp
|
||||||
unsafe {
|
unsafe {
|
||||||
if copy != 0 {
|
if copy != 0 {
|
||||||
if !src.is_null() && src_len > 0 {
|
if !src.is_null() && src_len > 0 {
|
||||||
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<wchar_t>() as u64) as
|
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<wchar_t>() as u64) as
|
||||||
*mut wchar_t;
|
*mut wchar_t;
|
||||||
if (*output).str.is_null() {
|
if (*output).str.is_null() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr::copy(src, (*output).str, src_len as usize);
|
ptr::copy(src, (*output).str, src_len as usize);
|
||||||
(*output).length = src_len;
|
(*output).length = src_len;
|
||||||
(*output).dtor = Some(string_wide_dtor as extern "C" fn(*mut wchar_t));
|
(*output).dtor = Some(string_wide_dtor as extern "C" fn(*mut wchar_t));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(*output).str = src as *mut _;
|
(*output).str = src as *mut _;
|
||||||
(*output).length = src_len;
|
(*output).length = src_len;
|
||||||
(*output).dtor = None;
|
(*output).dtor = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue