mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Fix various build warnings.
This commit is contained in:
parent
717805a593
commit
1604515fd9
16 changed files with 32 additions and 35 deletions
|
@ -67,7 +67,7 @@ pub extern "C" fn command_line_get_switch_value(cmd: *mut cef_command_line_t, na
|
|||
if o.as_slice().starts_with(opt.as_slice()) {
|
||||
let mut string = mem::uninitialized();
|
||||
let arg = o[opt.len() + 1..].as_bytes();
|
||||
let c_str = ffi::CString::from_slice(arg);
|
||||
let c_str = ffi::CString::new(arg).unwrap();
|
||||
cef_string_utf16_set(c_str.as_bytes().as_ptr() as *const _,
|
||||
arg.len() as size_t,
|
||||
&mut string,
|
||||
|
|
|
@ -47,7 +47,7 @@ fn load_gl() {
|
|||
|
||||
gl::load_with(|s| {
|
||||
unsafe {
|
||||
let c_str = CString::from_slice(s.as_bytes());
|
||||
let c_str = CString::new(s).unwrap();
|
||||
dlsym(RTLD_DEFAULT, c_str.as_ptr()) as *const c_void
|
||||
}
|
||||
});
|
||||
|
@ -61,7 +61,7 @@ fn load_gl() {
|
|||
|
||||
gl::load_with(|s| {
|
||||
unsafe {
|
||||
let c_str = CString::from_slice(s.as_bytes());
|
||||
let c_str = CString::new(s).unwrap();
|
||||
glXGetProcAddress(c_str.as_ptr()) as *const c_void
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue