mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Replace null-byte terminated string literals with C-string literals (#32716)
* simple conversion from byte string to c-string Signed-off-by: Bum Kim <bumcrystlbum@gmail.com> * convert byte strings to c-strings to c_char ptr Signed-off-by: Bum Kim <bumcrystlbum@gmail.com> --------- Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
This commit is contained in:
parent
59d0f1fe1a
commit
141a594e23
6 changed files with 29 additions and 29 deletions
|
@ -519,13 +519,13 @@ impl EventTarget {
|
|||
let name = CString::new(format!("on{}", &**ty)).unwrap();
|
||||
|
||||
// Step 3.9, subsection ParameterList
|
||||
const ARG_NAMES: &[*const c_char] = &[b"event\0" as *const u8 as *const c_char];
|
||||
const ARG_NAMES: &[*const c_char] = &[c"event".as_ptr()];
|
||||
const ERROR_ARG_NAMES: &[*const c_char] = &[
|
||||
b"event\0" as *const u8 as *const c_char,
|
||||
b"source\0" as *const u8 as *const c_char,
|
||||
b"lineno\0" as *const u8 as *const c_char,
|
||||
b"colno\0" as *const u8 as *const c_char,
|
||||
b"error\0" as *const u8 as *const c_char,
|
||||
c"event".as_ptr(),
|
||||
c"source".as_ptr(),
|
||||
c"lineno".as_ptr(),
|
||||
c"colno".as_ptr(),
|
||||
c"error".as_ptr(),
|
||||
];
|
||||
let is_error = ty == &atom!("error") && self.is::<Window>();
|
||||
let args = if is_error { ERROR_ARG_NAMES } else { ARG_NAMES };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue