Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit d90d7ab

Browse files
committed
Clean up some redundant casts
1 parent 7755559 commit d90d7ab

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub(crate) unsafe fn yaml_string_extend(
6060
new_start.wrapping_offset((*end).c_offset_from(*start) as libc::c_long as isize)
6161
as *mut libc::c_void,
6262
0,
63-
(*end).c_offset_from(*start) as libc::c_long as libc::c_ulong,
63+
(*end).c_offset_from(*start) as libc::c_ulong,
6464
);
6565
*pointer = new_start.wrapping_offset((*pointer).c_offset_from(*start) as libc::c_long as isize);
6666
*end = new_start.wrapping_offset(
@@ -88,7 +88,7 @@ pub(crate) unsafe fn yaml_string_join(
8888
memcpy(
8989
*a_pointer as *mut libc::c_void,
9090
*b_start as *const libc::c_void,
91-
(*b_pointer).c_offset_from(*b_start) as libc::c_long as libc::c_ulong,
91+
(*b_pointer).c_offset_from(*b_start) as libc::c_ulong,
9292
);
9393
*a_pointer =
9494
(*a_pointer).wrapping_offset((*b_pointer).c_offset_from(*b_start) as libc::c_long as isize);
@@ -149,7 +149,7 @@ pub(crate) unsafe fn yaml_queue_extend(
149149
*start,
150150
*head,
151151
(*tail as *mut libc::c_char).c_offset_from(*head as *mut libc::c_char)
152-
as libc::c_long as libc::c_ulong,
152+
as libc::c_ulong,
153153
);
154154
}
155155
*tail = (*start as *mut libc::c_char).wrapping_offset(

src/dumper.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ pub unsafe fn yaml_emitter_dump(
118118
*fresh1 = yaml_malloc(
119119
(size_of::<yaml_anchors_t>() as libc::c_ulong)
120120
.force_mul((*document).nodes.top.c_offset_from((*document).nodes.start)
121-
as libc::c_long as libc::c_ulong),
121+
as libc::c_ulong),
122122
) as *mut yaml_anchors_t;
123123
memset(
124124
(*emitter).anchors as *mut libc::c_void,
125125
0,
126126
(size_of::<yaml_anchors_t>() as libc::c_ulong)
127127
.force_mul((*document).nodes.top.c_offset_from((*document).nodes.start)
128-
as libc::c_long as libc::c_ulong),
128+
as libc::c_ulong),
129129
);
130130
memset(
131131
event as *mut libc::c_void,

src/emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ unsafe fn yaml_emitter_analyze_tag(emitter: *mut yaml_emitter_t, tag: *mut yaml_
14051405
let fresh49 = addr_of_mut!((*emitter).tag_data.suffix);
14061406
*fresh49 = string.start.wrapping_offset(prefix_length as isize);
14071407
(*emitter).tag_data.suffix_length = (string.end.c_offset_from(string.start)
1408-
as libc::c_long as libc::c_ulong)
1408+
as libc::c_ulong)
14091409
.wrapping_sub(prefix_length);
14101410
return OK;
14111411
}

src/scanner.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,9 @@ unsafe fn yaml_parser_save_simple_key(parser: *mut yaml_parser_t) -> Success {
363363
let simple_key = yaml_simple_key_t {
364364
possible: true,
365365
required,
366-
token_number: (*parser)
367-
.tokens_parsed
368-
.force_add((*parser).tokens.tail.c_offset_from((*parser).tokens.head)
369-
as libc::c_long as libc::c_ulong),
366+
token_number: (*parser).tokens_parsed.force_add(
367+
(*parser).tokens.tail.c_offset_from((*parser).tokens.head) as libc::c_ulong,
368+
),
370369
mark: (*parser).mark,
371370
};
372371
if yaml_parser_remove_simple_key(parser).fail {

0 commit comments

Comments
 (0)