mirror of
https://github.com/simonask/libyaml-safer
synced 2024-11-14 15:47:14 +00:00
Avoid mutable borrow reservation conflicts
This commit is contained in:
parent
9587d26afe
commit
9951855ff3
8 changed files with 1474 additions and 1415 deletions
384
src/api.rs
384
src/api.rs
|
@ -199,14 +199,14 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int,
|
||||
size_of::<yaml_parser_t>() as libc::c_ulong,
|
||||
);
|
||||
let fresh0 = &mut (*parser).raw_buffer.start;
|
||||
let fresh0 = addr_of_mut!((*parser).raw_buffer.start);
|
||||
*fresh0 = yaml_malloc(16384 as libc::c_int as size_t) as *mut yaml_char_t;
|
||||
if !(if !(*fresh0).is_null() {
|
||||
let fresh1 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh1 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh1 = (*parser).raw_buffer.start;
|
||||
let fresh2 = &mut (*parser).raw_buffer.last;
|
||||
let fresh2 = addr_of_mut!((*parser).raw_buffer.last);
|
||||
*fresh2 = *fresh1;
|
||||
let fresh3 = &mut (*parser).raw_buffer.end;
|
||||
let fresh3 = addr_of_mut!((*parser).raw_buffer.end);
|
||||
*fresh3 = ((*parser).raw_buffer.start).c_offset(16384 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -214,15 +214,15 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh4 = &mut (*parser).buffer.start;
|
||||
let fresh4 = addr_of_mut!((*parser).buffer.start);
|
||||
*fresh4 =
|
||||
yaml_malloc((16384 as libc::c_int * 3 as libc::c_int) as size_t) as *mut yaml_char_t;
|
||||
if !(if !(*fresh4).is_null() {
|
||||
let fresh5 = &mut (*parser).buffer.pointer;
|
||||
let fresh5 = addr_of_mut!((*parser).buffer.pointer);
|
||||
*fresh5 = (*parser).buffer.start;
|
||||
let fresh6 = &mut (*parser).buffer.last;
|
||||
let fresh6 = addr_of_mut!((*parser).buffer.last);
|
||||
*fresh6 = *fresh5;
|
||||
let fresh7 = &mut (*parser).buffer.end;
|
||||
let fresh7 = addr_of_mut!((*parser).buffer.end);
|
||||
*fresh7 = ((*parser).buffer.start)
|
||||
.c_offset((16384 as libc::c_int * 3 as libc::c_int) as isize);
|
||||
1 as libc::c_int
|
||||
|
@ -231,17 +231,17 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh8 = &mut (*parser).tokens.start;
|
||||
let fresh8 = addr_of_mut!((*parser).tokens.start);
|
||||
*fresh8 = yaml_malloc(
|
||||
(16 as libc::c_int as libc::c_ulong)
|
||||
.wrapping_mul(size_of::<yaml_token_t>() as libc::c_ulong),
|
||||
) as *mut yaml_token_t;
|
||||
if !(if !(*fresh8).is_null() {
|
||||
let fresh9 = &mut (*parser).tokens.tail;
|
||||
let fresh9 = addr_of_mut!((*parser).tokens.tail);
|
||||
*fresh9 = (*parser).tokens.start;
|
||||
let fresh10 = &mut (*parser).tokens.head;
|
||||
let fresh10 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh10 = *fresh9;
|
||||
let fresh11 = &mut (*parser).tokens.end;
|
||||
let fresh11 = addr_of_mut!((*parser).tokens.end);
|
||||
*fresh11 = ((*parser).tokens.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -249,7 +249,7 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh12 = &mut (*parser).indents.start;
|
||||
let fresh12 = addr_of_mut!((*parser).indents.start);
|
||||
*fresh12 =
|
||||
yaml_malloc((16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
libc::c_int,
|
||||
|
@ -257,9 +257,9 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
)
|
||||
as libc::c_ulong)) as *mut libc::c_int;
|
||||
if !(if !(*fresh12).is_null() {
|
||||
let fresh13 = &mut (*parser).indents.top;
|
||||
let fresh13 = addr_of_mut!((*parser).indents.top);
|
||||
*fresh13 = (*parser).indents.start;
|
||||
let fresh14 = &mut (*parser).indents.end;
|
||||
let fresh14 = addr_of_mut!((*parser).indents.end);
|
||||
*fresh14 = ((*parser).indents.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -267,7 +267,7 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh15 = &mut (*parser).simple_keys.start;
|
||||
let fresh15 = addr_of_mut!((*parser).simple_keys.start);
|
||||
*fresh15 =
|
||||
yaml_malloc((16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
yaml_simple_key_t,
|
||||
|
@ -275,9 +275,9 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
)
|
||||
as libc::c_ulong)) as *mut yaml_simple_key_t;
|
||||
if !(if !(*fresh15).is_null() {
|
||||
let fresh16 = &mut (*parser).simple_keys.top;
|
||||
let fresh16 = addr_of_mut!((*parser).simple_keys.top);
|
||||
*fresh16 = (*parser).simple_keys.start;
|
||||
let fresh17 = &mut (*parser).simple_keys.end;
|
||||
let fresh17 = addr_of_mut!((*parser).simple_keys.end);
|
||||
*fresh17 =
|
||||
((*parser).simple_keys.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
|
@ -286,7 +286,7 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh18 = &mut (*parser).states.start;
|
||||
let fresh18 = addr_of_mut!((*parser).states.start);
|
||||
*fresh18 = yaml_malloc(
|
||||
(16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
yaml_parser_state_t,
|
||||
|
@ -295,9 +295,9 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
as libc::c_ulong),
|
||||
) as *mut yaml_parser_state_t;
|
||||
if !(if !(*fresh18).is_null() {
|
||||
let fresh19 = &mut (*parser).states.top;
|
||||
let fresh19 = addr_of_mut!((*parser).states.top);
|
||||
*fresh19 = (*parser).states.start;
|
||||
let fresh20 = &mut (*parser).states.end;
|
||||
let fresh20 = addr_of_mut!((*parser).states.end);
|
||||
*fresh20 =
|
||||
((*parser).states.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
|
@ -306,7 +306,7 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh21 = &mut (*parser).marks.start;
|
||||
let fresh21 = addr_of_mut!((*parser).marks.start);
|
||||
*fresh21 = yaml_malloc(
|
||||
(16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
yaml_mark_t,
|
||||
|
@ -315,9 +315,9 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
as libc::c_ulong),
|
||||
) as *mut yaml_mark_t;
|
||||
if !(if !(*fresh21).is_null() {
|
||||
let fresh22 = &mut (*parser).marks.top;
|
||||
let fresh22 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh22 = (*parser).marks.start;
|
||||
let fresh23 = &mut (*parser).marks.end;
|
||||
let fresh23 = addr_of_mut!((*parser).marks.end);
|
||||
*fresh23 =
|
||||
((*parser).marks.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
|
@ -326,16 +326,16 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh24 = &mut (*parser).tag_directives.start;
|
||||
let fresh24 = addr_of_mut!((*parser).tag_directives.start);
|
||||
*fresh24 =
|
||||
yaml_malloc((16 as libc::c_int as libc::c_ulong).wrapping_mul(
|
||||
size_of::<yaml_tag_directive_t>() as libc::c_ulong,
|
||||
))
|
||||
as *mut yaml_tag_directive_t;
|
||||
if !(if !(*fresh24).is_null() {
|
||||
let fresh25 = &mut (*parser).tag_directives.top;
|
||||
let fresh25 = addr_of_mut!((*parser).tag_directives.top);
|
||||
*fresh25 = (*parser).tag_directives.start;
|
||||
let fresh26 = &mut (*parser).tag_directives.end;
|
||||
let fresh26 = addr_of_mut!((*parser).tag_directives.end);
|
||||
*fresh26 = ((*parser).tag_directives.start)
|
||||
.c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
|
@ -354,137 +354,137 @@ pub unsafe fn yaml_parser_initialize(mut parser: *mut yaml_parser_t) -> libc::c_
|
|||
}
|
||||
}
|
||||
yaml_free((*parser).raw_buffer.start as *mut libc::c_void);
|
||||
let fresh27 = &mut (*parser).raw_buffer.end;
|
||||
let fresh27 = addr_of_mut!((*parser).raw_buffer.end);
|
||||
*fresh27 = ptr::null_mut::<libc::c_uchar>();
|
||||
let fresh28 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh28 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh28 = *fresh27;
|
||||
let fresh29 = &mut (*parser).raw_buffer.start;
|
||||
let fresh29 = addr_of_mut!((*parser).raw_buffer.start);
|
||||
*fresh29 = *fresh28;
|
||||
yaml_free((*parser).buffer.start as *mut libc::c_void);
|
||||
let fresh30 = &mut (*parser).buffer.end;
|
||||
let fresh30 = addr_of_mut!((*parser).buffer.end);
|
||||
*fresh30 = ptr::null_mut::<yaml_char_t>();
|
||||
let fresh31 = &mut (*parser).buffer.pointer;
|
||||
let fresh31 = addr_of_mut!((*parser).buffer.pointer);
|
||||
*fresh31 = *fresh30;
|
||||
let fresh32 = &mut (*parser).buffer.start;
|
||||
let fresh32 = addr_of_mut!((*parser).buffer.start);
|
||||
*fresh32 = *fresh31;
|
||||
yaml_free((*parser).tokens.start as *mut libc::c_void);
|
||||
let fresh33 = &mut (*parser).tokens.end;
|
||||
let fresh33 = addr_of_mut!((*parser).tokens.end);
|
||||
*fresh33 = ptr::null_mut::<yaml_token_t>();
|
||||
let fresh34 = &mut (*parser).tokens.tail;
|
||||
let fresh34 = addr_of_mut!((*parser).tokens.tail);
|
||||
*fresh34 = *fresh33;
|
||||
let fresh35 = &mut (*parser).tokens.head;
|
||||
let fresh35 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh35 = *fresh34;
|
||||
let fresh36 = &mut (*parser).tokens.start;
|
||||
let fresh36 = addr_of_mut!((*parser).tokens.start);
|
||||
*fresh36 = *fresh35;
|
||||
yaml_free((*parser).indents.start as *mut libc::c_void);
|
||||
let fresh37 = &mut (*parser).indents.end;
|
||||
let fresh37 = addr_of_mut!((*parser).indents.end);
|
||||
*fresh37 = ptr::null_mut::<libc::c_int>();
|
||||
let fresh38 = &mut (*parser).indents.top;
|
||||
let fresh38 = addr_of_mut!((*parser).indents.top);
|
||||
*fresh38 = *fresh37;
|
||||
let fresh39 = &mut (*parser).indents.start;
|
||||
let fresh39 = addr_of_mut!((*parser).indents.start);
|
||||
*fresh39 = *fresh38;
|
||||
yaml_free((*parser).simple_keys.start as *mut libc::c_void);
|
||||
let fresh40 = &mut (*parser).simple_keys.end;
|
||||
let fresh40 = addr_of_mut!((*parser).simple_keys.end);
|
||||
*fresh40 = ptr::null_mut::<yaml_simple_key_t>();
|
||||
let fresh41 = &mut (*parser).simple_keys.top;
|
||||
let fresh41 = addr_of_mut!((*parser).simple_keys.top);
|
||||
*fresh41 = *fresh40;
|
||||
let fresh42 = &mut (*parser).simple_keys.start;
|
||||
let fresh42 = addr_of_mut!((*parser).simple_keys.start);
|
||||
*fresh42 = *fresh41;
|
||||
yaml_free((*parser).states.start as *mut libc::c_void);
|
||||
let fresh43 = &mut (*parser).states.end;
|
||||
let fresh43 = addr_of_mut!((*parser).states.end);
|
||||
*fresh43 = ptr::null_mut::<yaml_parser_state_t>();
|
||||
let fresh44 = &mut (*parser).states.top;
|
||||
let fresh44 = addr_of_mut!((*parser).states.top);
|
||||
*fresh44 = *fresh43;
|
||||
let fresh45 = &mut (*parser).states.start;
|
||||
let fresh45 = addr_of_mut!((*parser).states.start);
|
||||
*fresh45 = *fresh44;
|
||||
yaml_free((*parser).marks.start as *mut libc::c_void);
|
||||
let fresh46 = &mut (*parser).marks.end;
|
||||
let fresh46 = addr_of_mut!((*parser).marks.end);
|
||||
*fresh46 = ptr::null_mut::<yaml_mark_t>();
|
||||
let fresh47 = &mut (*parser).marks.top;
|
||||
let fresh47 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh47 = *fresh46;
|
||||
let fresh48 = &mut (*parser).marks.start;
|
||||
let fresh48 = addr_of_mut!((*parser).marks.start);
|
||||
*fresh48 = *fresh47;
|
||||
yaml_free((*parser).tag_directives.start as *mut libc::c_void);
|
||||
let fresh49 = &mut (*parser).tag_directives.end;
|
||||
let fresh49 = addr_of_mut!((*parser).tag_directives.end);
|
||||
*fresh49 = ptr::null_mut::<yaml_tag_directive_t>();
|
||||
let fresh50 = &mut (*parser).tag_directives.top;
|
||||
let fresh50 = addr_of_mut!((*parser).tag_directives.top);
|
||||
*fresh50 = *fresh49;
|
||||
let fresh51 = &mut (*parser).tag_directives.start;
|
||||
let fresh51 = addr_of_mut!((*parser).tag_directives.start);
|
||||
*fresh51 = *fresh50;
|
||||
0 as libc::c_int
|
||||
}
|
||||
pub unsafe fn yaml_parser_delete(parser: *mut yaml_parser_t) {
|
||||
__assert!(!parser.is_null());
|
||||
yaml_free((*parser).raw_buffer.start as *mut libc::c_void);
|
||||
let fresh52 = &mut (*parser).raw_buffer.end;
|
||||
let fresh52 = addr_of_mut!((*parser).raw_buffer.end);
|
||||
*fresh52 = ptr::null_mut::<libc::c_uchar>();
|
||||
let fresh53 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh53 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh53 = *fresh52;
|
||||
let fresh54 = &mut (*parser).raw_buffer.start;
|
||||
let fresh54 = addr_of_mut!((*parser).raw_buffer.start);
|
||||
*fresh54 = *fresh53;
|
||||
yaml_free((*parser).buffer.start as *mut libc::c_void);
|
||||
let fresh55 = &mut (*parser).buffer.end;
|
||||
let fresh55 = addr_of_mut!((*parser).buffer.end);
|
||||
*fresh55 = ptr::null_mut::<yaml_char_t>();
|
||||
let fresh56 = &mut (*parser).buffer.pointer;
|
||||
let fresh56 = addr_of_mut!((*parser).buffer.pointer);
|
||||
*fresh56 = *fresh55;
|
||||
let fresh57 = &mut (*parser).buffer.start;
|
||||
let fresh57 = addr_of_mut!((*parser).buffer.start);
|
||||
*fresh57 = *fresh56;
|
||||
while !((*parser).tokens.head == (*parser).tokens.tail) {
|
||||
let fresh58 = &mut (*parser).tokens.head;
|
||||
let fresh58 = addr_of_mut!((*parser).tokens.head);
|
||||
let fresh59 = *fresh58;
|
||||
*fresh58 = (*fresh58).c_offset(1);
|
||||
yaml_token_delete(fresh59);
|
||||
}
|
||||
yaml_free((*parser).tokens.start as *mut libc::c_void);
|
||||
let fresh60 = &mut (*parser).tokens.end;
|
||||
let fresh60 = addr_of_mut!((*parser).tokens.end);
|
||||
*fresh60 = ptr::null_mut::<yaml_token_t>();
|
||||
let fresh61 = &mut (*parser).tokens.tail;
|
||||
let fresh61 = addr_of_mut!((*parser).tokens.tail);
|
||||
*fresh61 = *fresh60;
|
||||
let fresh62 = &mut (*parser).tokens.head;
|
||||
let fresh62 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh62 = *fresh61;
|
||||
let fresh63 = &mut (*parser).tokens.start;
|
||||
let fresh63 = addr_of_mut!((*parser).tokens.start);
|
||||
*fresh63 = *fresh62;
|
||||
yaml_free((*parser).indents.start as *mut libc::c_void);
|
||||
let fresh64 = &mut (*parser).indents.end;
|
||||
let fresh64 = addr_of_mut!((*parser).indents.end);
|
||||
*fresh64 = ptr::null_mut::<libc::c_int>();
|
||||
let fresh65 = &mut (*parser).indents.top;
|
||||
let fresh65 = addr_of_mut!((*parser).indents.top);
|
||||
*fresh65 = *fresh64;
|
||||
let fresh66 = &mut (*parser).indents.start;
|
||||
let fresh66 = addr_of_mut!((*parser).indents.start);
|
||||
*fresh66 = *fresh65;
|
||||
yaml_free((*parser).simple_keys.start as *mut libc::c_void);
|
||||
let fresh67 = &mut (*parser).simple_keys.end;
|
||||
let fresh67 = addr_of_mut!((*parser).simple_keys.end);
|
||||
*fresh67 = ptr::null_mut::<yaml_simple_key_t>();
|
||||
let fresh68 = &mut (*parser).simple_keys.top;
|
||||
let fresh68 = addr_of_mut!((*parser).simple_keys.top);
|
||||
*fresh68 = *fresh67;
|
||||
let fresh69 = &mut (*parser).simple_keys.start;
|
||||
let fresh69 = addr_of_mut!((*parser).simple_keys.start);
|
||||
*fresh69 = *fresh68;
|
||||
yaml_free((*parser).states.start as *mut libc::c_void);
|
||||
let fresh70 = &mut (*parser).states.end;
|
||||
let fresh70 = addr_of_mut!((*parser).states.end);
|
||||
*fresh70 = ptr::null_mut::<yaml_parser_state_t>();
|
||||
let fresh71 = &mut (*parser).states.top;
|
||||
let fresh71 = addr_of_mut!((*parser).states.top);
|
||||
*fresh71 = *fresh70;
|
||||
let fresh72 = &mut (*parser).states.start;
|
||||
let fresh72 = addr_of_mut!((*parser).states.start);
|
||||
*fresh72 = *fresh71;
|
||||
yaml_free((*parser).marks.start as *mut libc::c_void);
|
||||
let fresh73 = &mut (*parser).marks.end;
|
||||
let fresh73 = addr_of_mut!((*parser).marks.end);
|
||||
*fresh73 = ptr::null_mut::<yaml_mark_t>();
|
||||
let fresh74 = &mut (*parser).marks.top;
|
||||
let fresh74 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh74 = *fresh73;
|
||||
let fresh75 = &mut (*parser).marks.start;
|
||||
let fresh75 = addr_of_mut!((*parser).marks.start);
|
||||
*fresh75 = *fresh74;
|
||||
while !((*parser).tag_directives.start == (*parser).tag_directives.top) {
|
||||
let fresh76 = &mut (*parser).tag_directives.top;
|
||||
let fresh76 = addr_of_mut!((*parser).tag_directives.top);
|
||||
*fresh76 = (*fresh76).c_offset(-1);
|
||||
let tag_directive: yaml_tag_directive_t = **fresh76;
|
||||
yaml_free(tag_directive.handle as *mut libc::c_void);
|
||||
yaml_free(tag_directive.prefix as *mut libc::c_void);
|
||||
}
|
||||
yaml_free((*parser).tag_directives.start as *mut libc::c_void);
|
||||
let fresh77 = &mut (*parser).tag_directives.end;
|
||||
let fresh77 = addr_of_mut!((*parser).tag_directives.end);
|
||||
*fresh77 = ptr::null_mut::<yaml_tag_directive_t>();
|
||||
let fresh78 = &mut (*parser).tag_directives.top;
|
||||
let fresh78 = addr_of_mut!((*parser).tag_directives.top);
|
||||
*fresh78 = *fresh77;
|
||||
let fresh79 = &mut (*parser).tag_directives.start;
|
||||
let fresh79 = addr_of_mut!((*parser).tag_directives.start);
|
||||
*fresh79 = *fresh78;
|
||||
memset(
|
||||
parser as *mut libc::c_void,
|
||||
|
@ -515,7 +515,7 @@ unsafe fn yaml_string_read_handler(
|
|||
(*parser).input.string.current as *const libc::c_void,
|
||||
size,
|
||||
);
|
||||
let fresh80 = &mut (*parser).input.string.current;
|
||||
let fresh80 = addr_of_mut!((*parser).input.string.current);
|
||||
*fresh80 = (*fresh80).c_offset(size as isize);
|
||||
*size_read = size;
|
||||
1 as libc::c_int
|
||||
|
@ -528,18 +528,18 @@ pub unsafe fn yaml_parser_set_input_string(
|
|||
__assert!(!parser.is_null());
|
||||
__assert!(((*parser).read_handler).is_none());
|
||||
__assert!(!input.is_null());
|
||||
let fresh81 = &mut (*parser).read_handler;
|
||||
let fresh81 = addr_of_mut!((*parser).read_handler);
|
||||
*fresh81 = Some(
|
||||
yaml_string_read_handler
|
||||
as unsafe fn(*mut libc::c_void, *mut libc::c_uchar, size_t, *mut size_t) -> libc::c_int,
|
||||
);
|
||||
let fresh82 = &mut (*parser).read_handler_data;
|
||||
let fresh82 = addr_of_mut!((*parser).read_handler_data);
|
||||
*fresh82 = parser as *mut libc::c_void;
|
||||
let fresh83 = &mut (*parser).input.string.start;
|
||||
let fresh83 = addr_of_mut!((*parser).input.string.start);
|
||||
*fresh83 = input;
|
||||
let fresh84 = &mut (*parser).input.string.current;
|
||||
let fresh84 = addr_of_mut!((*parser).input.string.current);
|
||||
*fresh84 = input;
|
||||
let fresh85 = &mut (*parser).input.string.end;
|
||||
let fresh85 = addr_of_mut!((*parser).input.string.end);
|
||||
*fresh85 = input.c_offset(size as isize);
|
||||
}
|
||||
pub unsafe fn yaml_parser_set_input(
|
||||
|
@ -550,9 +550,9 @@ pub unsafe fn yaml_parser_set_input(
|
|||
__assert!(!parser.is_null());
|
||||
__assert!(((*parser).read_handler).is_none());
|
||||
__assert!(handler.is_some());
|
||||
let fresh89 = &mut (*parser).read_handler;
|
||||
let fresh89 = addr_of_mut!((*parser).read_handler);
|
||||
*fresh89 = handler;
|
||||
let fresh90 = &mut (*parser).read_handler_data;
|
||||
let fresh90 = addr_of_mut!((*parser).read_handler_data);
|
||||
*fresh90 = data;
|
||||
}
|
||||
pub unsafe fn yaml_parser_set_encoding(mut parser: *mut yaml_parser_t, encoding: yaml_encoding_t) {
|
||||
|
@ -567,14 +567,14 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
0 as libc::c_int,
|
||||
size_of::<yaml_emitter_t>() as libc::c_ulong,
|
||||
);
|
||||
let fresh91 = &mut (*emitter).buffer.start;
|
||||
let fresh91 = addr_of_mut!((*emitter).buffer.start);
|
||||
*fresh91 = yaml_malloc(16384 as libc::c_int as size_t) as *mut yaml_char_t;
|
||||
if !(if !(*fresh91).is_null() {
|
||||
let fresh92 = &mut (*emitter).buffer.pointer;
|
||||
let fresh92 = addr_of_mut!((*emitter).buffer.pointer);
|
||||
*fresh92 = (*emitter).buffer.start;
|
||||
let fresh93 = &mut (*emitter).buffer.last;
|
||||
let fresh93 = addr_of_mut!((*emitter).buffer.last);
|
||||
*fresh93 = *fresh92;
|
||||
let fresh94 = &mut (*emitter).buffer.end;
|
||||
let fresh94 = addr_of_mut!((*emitter).buffer.end);
|
||||
*fresh94 = ((*emitter).buffer.start).c_offset(16384 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -582,16 +582,16 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh95 = &mut (*emitter).raw_buffer.start;
|
||||
let fresh95 = addr_of_mut!((*emitter).raw_buffer.start);
|
||||
*fresh95 =
|
||||
yaml_malloc((16384 as libc::c_int * 2 as libc::c_int + 2 as libc::c_int) as size_t)
|
||||
as *mut yaml_char_t;
|
||||
if !(if !(*fresh95).is_null() {
|
||||
let fresh96 = &mut (*emitter).raw_buffer.pointer;
|
||||
let fresh96 = addr_of_mut!((*emitter).raw_buffer.pointer);
|
||||
*fresh96 = (*emitter).raw_buffer.start;
|
||||
let fresh97 = &mut (*emitter).raw_buffer.last;
|
||||
let fresh97 = addr_of_mut!((*emitter).raw_buffer.last);
|
||||
*fresh97 = *fresh96;
|
||||
let fresh98 = &mut (*emitter).raw_buffer.end;
|
||||
let fresh98 = addr_of_mut!((*emitter).raw_buffer.end);
|
||||
*fresh98 = ((*emitter).raw_buffer.start)
|
||||
.c_offset((16384 as libc::c_int * 2 as libc::c_int + 2 as libc::c_int) as isize);
|
||||
1 as libc::c_int
|
||||
|
@ -600,15 +600,15 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh99 = &mut (*emitter).states.start;
|
||||
let fresh99 = addr_of_mut!((*emitter).states.start);
|
||||
*fresh99 = yaml_malloc(
|
||||
(16 as libc::c_int as libc::c_ulong)
|
||||
.wrapping_mul(size_of::<yaml_emitter_state_t>() as libc::c_ulong),
|
||||
) as *mut yaml_emitter_state_t;
|
||||
if !(if !(*fresh99).is_null() {
|
||||
let fresh100 = &mut (*emitter).states.top;
|
||||
let fresh100 = addr_of_mut!((*emitter).states.top);
|
||||
*fresh100 = (*emitter).states.start;
|
||||
let fresh101 = &mut (*emitter).states.end;
|
||||
let fresh101 = addr_of_mut!((*emitter).states.end);
|
||||
*fresh101 = ((*emitter).states.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -616,7 +616,7 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh102 = &mut (*emitter).events.start;
|
||||
let fresh102 = addr_of_mut!((*emitter).events.start);
|
||||
*fresh102 =
|
||||
yaml_malloc((16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
yaml_event_t,
|
||||
|
@ -624,11 +624,11 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
)
|
||||
as libc::c_ulong)) as *mut yaml_event_t;
|
||||
if !(if !(*fresh102).is_null() {
|
||||
let fresh103 = &mut (*emitter).events.tail;
|
||||
let fresh103 = addr_of_mut!((*emitter).events.tail);
|
||||
*fresh103 = (*emitter).events.start;
|
||||
let fresh104 = &mut (*emitter).events.head;
|
||||
let fresh104 = addr_of_mut!((*emitter).events.head);
|
||||
*fresh104 = *fresh103;
|
||||
let fresh105 = &mut (*emitter).events.end;
|
||||
let fresh105 = addr_of_mut!((*emitter).events.end);
|
||||
*fresh105 = ((*emitter).events.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -636,7 +636,7 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh106 = &mut (*emitter).indents.start;
|
||||
let fresh106 = addr_of_mut!((*emitter).indents.start);
|
||||
*fresh106 =
|
||||
yaml_malloc((16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
libc::c_int,
|
||||
|
@ -644,9 +644,9 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
)
|
||||
as libc::c_ulong)) as *mut libc::c_int;
|
||||
if !(if !(*fresh106).is_null() {
|
||||
let fresh107 = &mut (*emitter).indents.top;
|
||||
let fresh107 = addr_of_mut!((*emitter).indents.top);
|
||||
*fresh107 = (*emitter).indents.start;
|
||||
let fresh108 = &mut (*emitter).indents.end;
|
||||
let fresh108 = addr_of_mut!((*emitter).indents.end);
|
||||
*fresh108 = ((*emitter).indents.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -654,7 +654,7 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh109 = &mut (*emitter).tag_directives.start;
|
||||
let fresh109 = addr_of_mut!((*emitter).tag_directives.start);
|
||||
*fresh109 = yaml_malloc(
|
||||
(16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
yaml_tag_directive_t,
|
||||
|
@ -663,9 +663,9 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
as libc::c_ulong),
|
||||
) as *mut yaml_tag_directive_t;
|
||||
if !(if !(*fresh109).is_null() {
|
||||
let fresh110 = &mut (*emitter).tag_directives.top;
|
||||
let fresh110 = addr_of_mut!((*emitter).tag_directives.top);
|
||||
*fresh110 = (*emitter).tag_directives.start;
|
||||
let fresh111 = &mut (*emitter).tag_directives.end;
|
||||
let fresh111 = addr_of_mut!((*emitter).tag_directives.end);
|
||||
*fresh111 = ((*emitter).tag_directives.start)
|
||||
.c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
|
@ -682,109 +682,109 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> libc:
|
|||
}
|
||||
}
|
||||
yaml_free((*emitter).buffer.start as *mut libc::c_void);
|
||||
let fresh112 = &mut (*emitter).buffer.end;
|
||||
let fresh112 = addr_of_mut!((*emitter).buffer.end);
|
||||
*fresh112 = ptr::null_mut::<yaml_char_t>();
|
||||
let fresh113 = &mut (*emitter).buffer.pointer;
|
||||
let fresh113 = addr_of_mut!((*emitter).buffer.pointer);
|
||||
*fresh113 = *fresh112;
|
||||
let fresh114 = &mut (*emitter).buffer.start;
|
||||
let fresh114 = addr_of_mut!((*emitter).buffer.start);
|
||||
*fresh114 = *fresh113;
|
||||
yaml_free((*emitter).raw_buffer.start as *mut libc::c_void);
|
||||
let fresh115 = &mut (*emitter).raw_buffer.end;
|
||||
let fresh115 = addr_of_mut!((*emitter).raw_buffer.end);
|
||||
*fresh115 = ptr::null_mut::<libc::c_uchar>();
|
||||
let fresh116 = &mut (*emitter).raw_buffer.pointer;
|
||||
let fresh116 = addr_of_mut!((*emitter).raw_buffer.pointer);
|
||||
*fresh116 = *fresh115;
|
||||
let fresh117 = &mut (*emitter).raw_buffer.start;
|
||||
let fresh117 = addr_of_mut!((*emitter).raw_buffer.start);
|
||||
*fresh117 = *fresh116;
|
||||
yaml_free((*emitter).states.start as *mut libc::c_void);
|
||||
let fresh118 = &mut (*emitter).states.end;
|
||||
let fresh118 = addr_of_mut!((*emitter).states.end);
|
||||
*fresh118 = ptr::null_mut::<yaml_emitter_state_t>();
|
||||
let fresh119 = &mut (*emitter).states.top;
|
||||
let fresh119 = addr_of_mut!((*emitter).states.top);
|
||||
*fresh119 = *fresh118;
|
||||
let fresh120 = &mut (*emitter).states.start;
|
||||
let fresh120 = addr_of_mut!((*emitter).states.start);
|
||||
*fresh120 = *fresh119;
|
||||
yaml_free((*emitter).events.start as *mut libc::c_void);
|
||||
let fresh121 = &mut (*emitter).events.end;
|
||||
let fresh121 = addr_of_mut!((*emitter).events.end);
|
||||
*fresh121 = ptr::null_mut::<yaml_event_t>();
|
||||
let fresh122 = &mut (*emitter).events.tail;
|
||||
let fresh122 = addr_of_mut!((*emitter).events.tail);
|
||||
*fresh122 = *fresh121;
|
||||
let fresh123 = &mut (*emitter).events.head;
|
||||
let fresh123 = addr_of_mut!((*emitter).events.head);
|
||||
*fresh123 = *fresh122;
|
||||
let fresh124 = &mut (*emitter).events.start;
|
||||
let fresh124 = addr_of_mut!((*emitter).events.start);
|
||||
*fresh124 = *fresh123;
|
||||
yaml_free((*emitter).indents.start as *mut libc::c_void);
|
||||
let fresh125 = &mut (*emitter).indents.end;
|
||||
let fresh125 = addr_of_mut!((*emitter).indents.end);
|
||||
*fresh125 = ptr::null_mut::<libc::c_int>();
|
||||
let fresh126 = &mut (*emitter).indents.top;
|
||||
let fresh126 = addr_of_mut!((*emitter).indents.top);
|
||||
*fresh126 = *fresh125;
|
||||
let fresh127 = &mut (*emitter).indents.start;
|
||||
let fresh127 = addr_of_mut!((*emitter).indents.start);
|
||||
*fresh127 = *fresh126;
|
||||
yaml_free((*emitter).tag_directives.start as *mut libc::c_void);
|
||||
let fresh128 = &mut (*emitter).tag_directives.end;
|
||||
let fresh128 = addr_of_mut!((*emitter).tag_directives.end);
|
||||
*fresh128 = ptr::null_mut::<yaml_tag_directive_t>();
|
||||
let fresh129 = &mut (*emitter).tag_directives.top;
|
||||
let fresh129 = addr_of_mut!((*emitter).tag_directives.top);
|
||||
*fresh129 = *fresh128;
|
||||
let fresh130 = &mut (*emitter).tag_directives.start;
|
||||
let fresh130 = addr_of_mut!((*emitter).tag_directives.start);
|
||||
*fresh130 = *fresh129;
|
||||
0 as libc::c_int
|
||||
}
|
||||
pub unsafe fn yaml_emitter_delete(emitter: *mut yaml_emitter_t) {
|
||||
__assert!(!emitter.is_null());
|
||||
yaml_free((*emitter).buffer.start as *mut libc::c_void);
|
||||
let fresh131 = &mut (*emitter).buffer.end;
|
||||
let fresh131 = addr_of_mut!((*emitter).buffer.end);
|
||||
*fresh131 = ptr::null_mut::<yaml_char_t>();
|
||||
let fresh132 = &mut (*emitter).buffer.pointer;
|
||||
let fresh132 = addr_of_mut!((*emitter).buffer.pointer);
|
||||
*fresh132 = *fresh131;
|
||||
let fresh133 = &mut (*emitter).buffer.start;
|
||||
let fresh133 = addr_of_mut!((*emitter).buffer.start);
|
||||
*fresh133 = *fresh132;
|
||||
yaml_free((*emitter).raw_buffer.start as *mut libc::c_void);
|
||||
let fresh134 = &mut (*emitter).raw_buffer.end;
|
||||
let fresh134 = addr_of_mut!((*emitter).raw_buffer.end);
|
||||
*fresh134 = ptr::null_mut::<libc::c_uchar>();
|
||||
let fresh135 = &mut (*emitter).raw_buffer.pointer;
|
||||
let fresh135 = addr_of_mut!((*emitter).raw_buffer.pointer);
|
||||
*fresh135 = *fresh134;
|
||||
let fresh136 = &mut (*emitter).raw_buffer.start;
|
||||
let fresh136 = addr_of_mut!((*emitter).raw_buffer.start);
|
||||
*fresh136 = *fresh135;
|
||||
yaml_free((*emitter).states.start as *mut libc::c_void);
|
||||
let fresh137 = &mut (*emitter).states.end;
|
||||
let fresh137 = addr_of_mut!((*emitter).states.end);
|
||||
*fresh137 = ptr::null_mut::<yaml_emitter_state_t>();
|
||||
let fresh138 = &mut (*emitter).states.top;
|
||||
let fresh138 = addr_of_mut!((*emitter).states.top);
|
||||
*fresh138 = *fresh137;
|
||||
let fresh139 = &mut (*emitter).states.start;
|
||||
let fresh139 = addr_of_mut!((*emitter).states.start);
|
||||
*fresh139 = *fresh138;
|
||||
while !((*emitter).events.head == (*emitter).events.tail) {
|
||||
let fresh140 = &mut (*emitter).events.head;
|
||||
let fresh140 = addr_of_mut!((*emitter).events.head);
|
||||
let fresh141 = *fresh140;
|
||||
*fresh140 = (*fresh140).c_offset(1);
|
||||
yaml_event_delete(fresh141);
|
||||
}
|
||||
yaml_free((*emitter).events.start as *mut libc::c_void);
|
||||
let fresh142 = &mut (*emitter).events.end;
|
||||
let fresh142 = addr_of_mut!((*emitter).events.end);
|
||||
*fresh142 = ptr::null_mut::<yaml_event_t>();
|
||||
let fresh143 = &mut (*emitter).events.tail;
|
||||
let fresh143 = addr_of_mut!((*emitter).events.tail);
|
||||
*fresh143 = *fresh142;
|
||||
let fresh144 = &mut (*emitter).events.head;
|
||||
let fresh144 = addr_of_mut!((*emitter).events.head);
|
||||
*fresh144 = *fresh143;
|
||||
let fresh145 = &mut (*emitter).events.start;
|
||||
let fresh145 = addr_of_mut!((*emitter).events.start);
|
||||
*fresh145 = *fresh144;
|
||||
yaml_free((*emitter).indents.start as *mut libc::c_void);
|
||||
let fresh146 = &mut (*emitter).indents.end;
|
||||
let fresh146 = addr_of_mut!((*emitter).indents.end);
|
||||
*fresh146 = ptr::null_mut::<libc::c_int>();
|
||||
let fresh147 = &mut (*emitter).indents.top;
|
||||
let fresh147 = addr_of_mut!((*emitter).indents.top);
|
||||
*fresh147 = *fresh146;
|
||||
let fresh148 = &mut (*emitter).indents.start;
|
||||
let fresh148 = addr_of_mut!((*emitter).indents.start);
|
||||
*fresh148 = *fresh147;
|
||||
while !((*emitter).tag_directives.start == (*emitter).tag_directives.top) {
|
||||
let fresh149 = &mut (*emitter).tag_directives.top;
|
||||
let fresh149 = addr_of_mut!((*emitter).tag_directives.top);
|
||||
*fresh149 = (*fresh149).c_offset(-1);
|
||||
let tag_directive: yaml_tag_directive_t = **fresh149;
|
||||
yaml_free(tag_directive.handle as *mut libc::c_void);
|
||||
yaml_free(tag_directive.prefix as *mut libc::c_void);
|
||||
}
|
||||
yaml_free((*emitter).tag_directives.start as *mut libc::c_void);
|
||||
let fresh150 = &mut (*emitter).tag_directives.end;
|
||||
let fresh150 = addr_of_mut!((*emitter).tag_directives.end);
|
||||
*fresh150 = ptr::null_mut::<yaml_tag_directive_t>();
|
||||
let fresh151 = &mut (*emitter).tag_directives.top;
|
||||
let fresh151 = addr_of_mut!((*emitter).tag_directives.top);
|
||||
*fresh151 = *fresh150;
|
||||
let fresh152 = &mut (*emitter).tag_directives.start;
|
||||
let fresh152 = addr_of_mut!((*emitter).tag_directives.start);
|
||||
*fresh152 = *fresh151;
|
||||
yaml_free((*emitter).anchors as *mut libc::c_void);
|
||||
memset(
|
||||
|
@ -816,7 +816,7 @@ unsafe fn yaml_string_write_handler(
|
|||
buffer as *const libc::c_void,
|
||||
size,
|
||||
);
|
||||
let fresh153 = &mut (*(*emitter).output.string.size_written);
|
||||
let fresh153 = addr_of_mut!((*(*emitter).output.string.size_written));
|
||||
*fresh153 = (*fresh153 as libc::c_ulong).wrapping_add(size) as size_t as size_t;
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
@ -829,17 +829,17 @@ pub unsafe fn yaml_emitter_set_output_string(
|
|||
__assert!(!emitter.is_null());
|
||||
__assert!(((*emitter).write_handler).is_none());
|
||||
__assert!(!output.is_null());
|
||||
let fresh154 = &mut (*emitter).write_handler;
|
||||
let fresh154 = addr_of_mut!((*emitter).write_handler);
|
||||
*fresh154 = Some(
|
||||
yaml_string_write_handler
|
||||
as unsafe fn(*mut libc::c_void, *mut libc::c_uchar, size_t) -> libc::c_int,
|
||||
);
|
||||
let fresh155 = &mut (*emitter).write_handler_data;
|
||||
let fresh155 = addr_of_mut!((*emitter).write_handler_data);
|
||||
*fresh155 = emitter as *mut libc::c_void;
|
||||
let fresh156 = &mut (*emitter).output.string.buffer;
|
||||
let fresh156 = addr_of_mut!((*emitter).output.string.buffer);
|
||||
*fresh156 = output;
|
||||
(*emitter).output.string.size = size;
|
||||
let fresh157 = &mut (*emitter).output.string.size_written;
|
||||
let fresh157 = addr_of_mut!((*emitter).output.string.size_written);
|
||||
*fresh157 = size_written;
|
||||
*size_written = 0 as libc::c_int as size_t;
|
||||
}
|
||||
|
@ -851,9 +851,9 @@ pub unsafe fn yaml_emitter_set_output(
|
|||
__assert!(!emitter.is_null());
|
||||
__assert!(((*emitter).write_handler).is_none());
|
||||
__assert!(handler.is_some());
|
||||
let fresh161 = &mut (*emitter).write_handler;
|
||||
let fresh161 = addr_of_mut!((*emitter).write_handler);
|
||||
*fresh161 = handler;
|
||||
let fresh162 = &mut (*emitter).write_handler_data;
|
||||
let fresh162 = addr_of_mut!((*emitter).write_handler_data);
|
||||
*fresh162 = data;
|
||||
}
|
||||
pub unsafe fn yaml_emitter_set_encoding(
|
||||
|
@ -1154,11 +1154,11 @@ pub unsafe fn yaml_document_start_event_initialize(
|
|||
(*event).type_0 = YAML_DOCUMENT_START_EVENT;
|
||||
(*event).start_mark = mark;
|
||||
(*event).end_mark = mark;
|
||||
let fresh164 = &mut (*event).data.document_start.version_directive;
|
||||
let fresh164 = addr_of_mut!((*event).data.document_start.version_directive);
|
||||
*fresh164 = version_directive_copy;
|
||||
let fresh165 = &mut (*event).data.document_start.tag_directives.start;
|
||||
let fresh165 = addr_of_mut!((*event).data.document_start.tag_directives.start);
|
||||
*fresh165 = tag_directives_copy.start;
|
||||
let fresh166 = &mut (*event).data.document_start.tag_directives.end;
|
||||
let fresh166 = addr_of_mut!((*event).data.document_start.tag_directives.end);
|
||||
*fresh166 = tag_directives_copy.top;
|
||||
(*event).data.document_start.implicit = implicit;
|
||||
return 1 as libc::c_int;
|
||||
|
@ -1229,7 +1229,7 @@ pub unsafe fn yaml_alias_event_initialize(
|
|||
(*event).type_0 = YAML_ALIAS_EVENT;
|
||||
(*event).start_mark = mark;
|
||||
(*event).end_mark = mark;
|
||||
let fresh167 = &mut (*event).data.alias.anchor;
|
||||
let fresh167 = addr_of_mut!((*event).data.alias.anchor);
|
||||
*fresh167 = anchor_copy;
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
@ -1308,11 +1308,11 @@ pub unsafe fn yaml_scalar_event_initialize(
|
|||
(*event).type_0 = YAML_SCALAR_EVENT;
|
||||
(*event).start_mark = mark;
|
||||
(*event).end_mark = mark;
|
||||
let fresh168 = &mut (*event).data.scalar.anchor;
|
||||
let fresh168 = addr_of_mut!((*event).data.scalar.anchor);
|
||||
*fresh168 = anchor_copy;
|
||||
let fresh169 = &mut (*event).data.scalar.tag;
|
||||
let fresh169 = addr_of_mut!((*event).data.scalar.tag);
|
||||
*fresh169 = tag_copy;
|
||||
let fresh170 = &mut (*event).data.scalar.value;
|
||||
let fresh170 = addr_of_mut!((*event).data.scalar.value);
|
||||
*fresh170 = value_copy;
|
||||
(*event).data.scalar.length = length as size_t;
|
||||
(*event).data.scalar.plain_implicit = plain_implicit;
|
||||
|
@ -1388,9 +1388,9 @@ pub unsafe fn yaml_sequence_start_event_initialize(
|
|||
(*event).type_0 = YAML_SEQUENCE_START_EVENT;
|
||||
(*event).start_mark = mark;
|
||||
(*event).end_mark = mark;
|
||||
let fresh171 = &mut (*event).data.sequence_start.anchor;
|
||||
let fresh171 = addr_of_mut!((*event).data.sequence_start.anchor);
|
||||
*fresh171 = anchor_copy;
|
||||
let fresh172 = &mut (*event).data.sequence_start.tag;
|
||||
let fresh172 = addr_of_mut!((*event).data.sequence_start.tag);
|
||||
*fresh172 = tag_copy;
|
||||
(*event).data.sequence_start.implicit = implicit;
|
||||
(*event).data.sequence_start.style = style;
|
||||
|
@ -1478,9 +1478,9 @@ pub unsafe fn yaml_mapping_start_event_initialize(
|
|||
(*event).type_0 = YAML_MAPPING_START_EVENT;
|
||||
(*event).start_mark = mark;
|
||||
(*event).end_mark = mark;
|
||||
let fresh173 = &mut (*event).data.mapping_start.anchor;
|
||||
let fresh173 = addr_of_mut!((*event).data.mapping_start.anchor);
|
||||
*fresh173 = anchor_copy;
|
||||
let fresh174 = &mut (*event).data.mapping_start.tag;
|
||||
let fresh174 = addr_of_mut!((*event).data.mapping_start.tag);
|
||||
*fresh174 = tag_copy;
|
||||
(*event).data.mapping_start.implicit = implicit;
|
||||
(*event).data.mapping_start.style = style;
|
||||
|
@ -1703,17 +1703,17 @@ pub unsafe fn yaml_document_initialize(
|
|||
0 as libc::c_int,
|
||||
size_of::<yaml_document_t>() as libc::c_ulong,
|
||||
);
|
||||
let fresh176 = &mut (*document).nodes.start;
|
||||
let fresh176 = addr_of_mut!((*document).nodes.start);
|
||||
*fresh176 = nodes.start;
|
||||
let fresh177 = &mut (*document).nodes.end;
|
||||
let fresh177 = addr_of_mut!((*document).nodes.end);
|
||||
*fresh177 = nodes.end;
|
||||
let fresh178 = &mut (*document).nodes.top;
|
||||
let fresh178 = addr_of_mut!((*document).nodes.top);
|
||||
*fresh178 = nodes.start;
|
||||
let fresh179 = &mut (*document).version_directive;
|
||||
let fresh179 = addr_of_mut!((*document).version_directive);
|
||||
*fresh179 = version_directive_copy;
|
||||
let fresh180 = &mut (*document).tag_directives.start;
|
||||
let fresh180 = addr_of_mut!((*document).tag_directives.start);
|
||||
*fresh180 = tag_directives_copy.start;
|
||||
let fresh181 = &mut (*document).tag_directives.end;
|
||||
let fresh181 = addr_of_mut!((*document).tag_directives.end);
|
||||
*fresh181 = tag_directives_copy.top;
|
||||
(*document).start_implicit = start_implicit;
|
||||
(*document).end_implicit = end_implicit;
|
||||
|
@ -1748,7 +1748,7 @@ pub unsafe fn yaml_document_delete(document: *mut yaml_document_t) {
|
|||
let mut tag_directive: *mut yaml_tag_directive_t;
|
||||
__assert!(!document.is_null());
|
||||
while !((*document).nodes.start == (*document).nodes.top) {
|
||||
let fresh182 = &mut (*document).nodes.top;
|
||||
let fresh182 = addr_of_mut!((*document).nodes.top);
|
||||
*fresh182 = (*fresh182).c_offset(-1);
|
||||
let mut node: yaml_node_t = **fresh182;
|
||||
yaml_free(node.tag as *mut libc::c_void);
|
||||
|
@ -1774,11 +1774,11 @@ pub unsafe fn yaml_document_delete(document: *mut yaml_document_t) {
|
|||
}
|
||||
}
|
||||
yaml_free((*document).nodes.start as *mut libc::c_void);
|
||||
let fresh183 = &mut (*document).nodes.end;
|
||||
let fresh183 = addr_of_mut!((*document).nodes.end);
|
||||
*fresh183 = ptr::null_mut::<yaml_node_t>();
|
||||
let fresh184 = &mut (*document).nodes.top;
|
||||
let fresh184 = addr_of_mut!((*document).nodes.top);
|
||||
*fresh184 = *fresh183;
|
||||
let fresh185 = &mut (*document).nodes.start;
|
||||
let fresh185 = addr_of_mut!((*document).nodes.start);
|
||||
*fresh185 = *fresh184;
|
||||
yaml_free((*document).version_directive as *mut libc::c_void);
|
||||
tag_directive = (*document).tag_directives.start;
|
||||
|
@ -1892,7 +1892,7 @@ pub unsafe fn yaml_document_add_scalar(
|
|||
addr_of_mut!((*document).nodes.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh186 = &mut (*document).nodes.top;
|
||||
let fresh186 = addr_of_mut!((*document).nodes.top);
|
||||
let fresh187 = *fresh186;
|
||||
*fresh186 = (*fresh186).c_offset(1);
|
||||
*fresh187 = node;
|
||||
|
@ -1994,7 +1994,7 @@ pub unsafe fn yaml_document_add_sequence(
|
|||
addr_of_mut!((*document).nodes.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh188 = &mut (*document).nodes.top;
|
||||
let fresh188 = addr_of_mut!((*document).nodes.top);
|
||||
let fresh189 = *fresh188;
|
||||
*fresh188 = (*fresh188).c_offset(1);
|
||||
*fresh189 = node;
|
||||
|
@ -2098,7 +2098,7 @@ pub unsafe fn yaml_document_add_mapping(
|
|||
addr_of_mut!((*document).nodes.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh190 = &mut (*document).nodes.top;
|
||||
let fresh190 = addr_of_mut!((*document).nodes.top);
|
||||
let fresh191 = *fresh190;
|
||||
*fresh190 = (*fresh190).c_offset(1);
|
||||
*fresh191 = node;
|
||||
|
@ -2177,12 +2177,13 @@ pub unsafe fn yaml_document_append_sequence_item(
|
|||
) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh192 = &mut (*((*document).nodes.start)
|
||||
.c_offset((sequence - 1 as libc::c_int) as isize))
|
||||
.data
|
||||
.sequence
|
||||
.items
|
||||
.top;
|
||||
let fresh192 = addr_of_mut!(
|
||||
(*((*document).nodes.start).c_offset((sequence - 1 as libc::c_int) as isize))
|
||||
.data
|
||||
.sequence
|
||||
.items
|
||||
.top
|
||||
);
|
||||
let fresh193 = *fresh192;
|
||||
*fresh192 = (*fresh192).c_offset(1);
|
||||
*fresh193 = item;
|
||||
|
@ -2260,12 +2261,13 @@ pub unsafe fn yaml_document_append_mapping_pair(
|
|||
) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh194 = &mut (*((*document).nodes.start)
|
||||
.c_offset((mapping - 1 as libc::c_int) as isize))
|
||||
.data
|
||||
.mapping
|
||||
.pairs
|
||||
.top;
|
||||
let fresh194 = addr_of_mut!(
|
||||
(*((*document).nodes.start).c_offset((mapping - 1 as libc::c_int) as isize))
|
||||
.data
|
||||
.mapping
|
||||
.pairs
|
||||
.top
|
||||
);
|
||||
let fresh195 = *fresh194;
|
||||
*fresh194 = (*fresh194).c_offset(1);
|
||||
*fresh195 = pair;
|
||||
|
|
|
@ -10,7 +10,7 @@ use crate::yaml::{
|
|||
use crate::{libc, yaml_document_delete, yaml_emitter_emit, yaml_free, yaml_malloc, PointerExt};
|
||||
use std::io::Write;
|
||||
use std::mem::{size_of, MaybeUninit};
|
||||
use std::ptr;
|
||||
use std::ptr::{self, addr_of_mut};
|
||||
use std::slice;
|
||||
pub unsafe fn yaml_emitter_open(mut emitter: *mut yaml_emitter_t) -> libc::c_int {
|
||||
let mut event = MaybeUninit::<yaml_event_t>::uninit();
|
||||
|
@ -78,7 +78,7 @@ pub unsafe fn yaml_emitter_dump(
|
|||
};
|
||||
__assert!(!emitter.is_null());
|
||||
__assert!(!document.is_null());
|
||||
let fresh0 = &mut (*emitter).document;
|
||||
let fresh0 = addr_of_mut!((*emitter).document);
|
||||
*fresh0 = document;
|
||||
if (*emitter).opened == 0 {
|
||||
if yaml_emitter_open(emitter) == 0 {
|
||||
|
@ -98,7 +98,7 @@ pub unsafe fn yaml_emitter_dump(
|
|||
}
|
||||
} else {
|
||||
__assert!((*emitter).opened != 0);
|
||||
let fresh1 = &mut (*emitter).anchors;
|
||||
let fresh1 = addr_of_mut!((*emitter).anchors);
|
||||
*fresh1 = yaml_malloc((size_of::<yaml_anchors_t>() as libc::c_ulong).wrapping_mul(
|
||||
((*document).nodes.top).c_offset_from((*document).nodes.start) as libc::c_long
|
||||
as libc::c_ulong,
|
||||
|
@ -156,7 +156,7 @@ unsafe fn yaml_emitter_delete_document_and_anchors(mut emitter: *mut yaml_emitte
|
|||
let mut index: libc::c_int;
|
||||
if ((*emitter).anchors).is_null() {
|
||||
yaml_document_delete((*emitter).document);
|
||||
let fresh2 = &mut (*emitter).document;
|
||||
let fresh2 = addr_of_mut!((*emitter).document);
|
||||
*fresh2 = ptr::null_mut::<yaml_document_t>();
|
||||
return;
|
||||
}
|
||||
|
@ -186,17 +186,17 @@ unsafe fn yaml_emitter_delete_document_and_anchors(mut emitter: *mut yaml_emitte
|
|||
index += 1;
|
||||
}
|
||||
yaml_free((*(*emitter).document).nodes.start as *mut libc::c_void);
|
||||
let fresh3 = &mut (*(*emitter).document).nodes.end;
|
||||
let fresh3 = addr_of_mut!((*(*emitter).document).nodes.end);
|
||||
*fresh3 = ptr::null_mut::<yaml_node_t>();
|
||||
let fresh4 = &mut (*(*emitter).document).nodes.top;
|
||||
let fresh4 = addr_of_mut!((*(*emitter).document).nodes.top);
|
||||
*fresh4 = *fresh3;
|
||||
let fresh5 = &mut (*(*emitter).document).nodes.start;
|
||||
let fresh5 = addr_of_mut!((*(*emitter).document).nodes.start);
|
||||
*fresh5 = *fresh4;
|
||||
yaml_free((*emitter).anchors as *mut libc::c_void);
|
||||
let fresh6 = &mut (*emitter).anchors;
|
||||
let fresh6 = addr_of_mut!((*emitter).anchors);
|
||||
*fresh6 = ptr::null_mut::<yaml_anchors_t>();
|
||||
(*emitter).last_anchor_id = 0 as libc::c_int;
|
||||
let fresh7 = &mut (*emitter).document;
|
||||
let fresh7 = addr_of_mut!((*emitter).document);
|
||||
*fresh7 = ptr::null_mut::<yaml_document_t>();
|
||||
}
|
||||
unsafe fn yaml_emitter_anchor_node(emitter: *mut yaml_emitter_t, index: libc::c_int) {
|
||||
|
@ -205,8 +205,9 @@ unsafe fn yaml_emitter_anchor_node(emitter: *mut yaml_emitter_t, index: libc::c_
|
|||
.c_offset(-(1 as libc::c_int as isize));
|
||||
let mut item: *mut yaml_node_item_t;
|
||||
let mut pair: *mut yaml_node_pair_t;
|
||||
let fresh8 =
|
||||
&mut (*((*emitter).anchors).c_offset((index - 1 as libc::c_int) as isize)).references;
|
||||
let fresh8 = addr_of_mut!(
|
||||
(*((*emitter).anchors).c_offset((index - 1 as libc::c_int) as isize)).references
|
||||
);
|
||||
*fresh8 += 1;
|
||||
if (*((*emitter).anchors).c_offset((index - 1 as libc::c_int) as isize)).references
|
||||
== 1 as libc::c_int
|
||||
|
@ -232,7 +233,7 @@ unsafe fn yaml_emitter_anchor_node(emitter: *mut yaml_emitter_t, index: libc::c_
|
|||
} else if (*((*emitter).anchors).c_offset((index - 1 as libc::c_int) as isize)).references
|
||||
== 2 as libc::c_int
|
||||
{
|
||||
let fresh9 = &mut (*emitter).last_anchor_id;
|
||||
let fresh9 = addr_of_mut!((*emitter).last_anchor_id);
|
||||
*fresh9 += 1;
|
||||
(*((*emitter).anchors).c_offset((index - 1 as libc::c_int) as isize)).anchor = *fresh9;
|
||||
}
|
||||
|
|
662
src/emitter.rs
662
src/emitter.rs
File diff suppressed because it is too large
Load diff
|
@ -48,15 +48,15 @@ pub unsafe fn yaml_parser_load(
|
|||
0 as libc::c_int,
|
||||
size_of::<yaml_document_t>() as libc::c_ulong,
|
||||
);
|
||||
let fresh0 = &mut (*document).nodes.start;
|
||||
let fresh0 = addr_of_mut!((*document).nodes.start);
|
||||
*fresh0 = yaml_malloc(
|
||||
(16 as libc::c_int as libc::c_ulong)
|
||||
.wrapping_mul(size_of::<yaml_node_t>() as libc::c_ulong),
|
||||
) as *mut yaml_node_t;
|
||||
if !(if !(*fresh0).is_null() {
|
||||
let fresh1 = &mut (*document).nodes.top;
|
||||
let fresh1 = addr_of_mut!((*document).nodes.top);
|
||||
*fresh1 = (*document).nodes.start;
|
||||
let fresh2 = &mut (*document).nodes.end;
|
||||
let fresh2 = addr_of_mut!((*document).nodes.end);
|
||||
*fresh2 = ((*document).nodes.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -89,7 +89,7 @@ pub unsafe fn yaml_parser_load(
|
|||
{
|
||||
return 1 as libc::c_int;
|
||||
}
|
||||
let fresh3 = &mut (*parser).aliases.start;
|
||||
let fresh3 = addr_of_mut!((*parser).aliases.start);
|
||||
*fresh3 =
|
||||
yaml_malloc((16 as libc::c_int as libc::c_ulong).wrapping_mul(size_of::<
|
||||
yaml_alias_data_t,
|
||||
|
@ -97,9 +97,9 @@ pub unsafe fn yaml_parser_load(
|
|||
)
|
||||
as libc::c_ulong)) as *mut yaml_alias_data_t;
|
||||
if !(if !(*fresh3).is_null() {
|
||||
let fresh4 = &mut (*parser).aliases.top;
|
||||
let fresh4 = addr_of_mut!((*parser).aliases.top);
|
||||
*fresh4 = (*parser).aliases.start;
|
||||
let fresh5 = &mut (*parser).aliases.end;
|
||||
let fresh5 = addr_of_mut!((*parser).aliases.end);
|
||||
*fresh5 = ((*parser).aliases.start).c_offset(16 as libc::c_int as isize);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -107,11 +107,11 @@ pub unsafe fn yaml_parser_load(
|
|||
0 as libc::c_int
|
||||
} == 0)
|
||||
{
|
||||
let fresh6 = &mut (*parser).document;
|
||||
let fresh6 = addr_of_mut!((*parser).document);
|
||||
*fresh6 = document;
|
||||
if !(yaml_parser_load_document(parser, event) == 0) {
|
||||
yaml_parser_delete_aliases(parser);
|
||||
let fresh7 = &mut (*parser).document;
|
||||
let fresh7 = addr_of_mut!((*parser).document);
|
||||
*fresh7 = ptr::null_mut::<yaml_document_t>();
|
||||
return 1 as libc::c_int;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ pub unsafe fn yaml_parser_load(
|
|||
}
|
||||
yaml_parser_delete_aliases(parser);
|
||||
yaml_document_delete(document);
|
||||
let fresh8 = &mut (*parser).document;
|
||||
let fresh8 = addr_of_mut!((*parser).document);
|
||||
*fresh8 = ptr::null_mut::<yaml_document_t>();
|
||||
0 as libc::c_int
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ unsafe fn yaml_parser_set_composer_error(
|
|||
problem_mark: yaml_mark_t,
|
||||
) -> libc::c_int {
|
||||
(*parser).error = YAML_COMPOSER_ERROR;
|
||||
let fresh9 = &mut (*parser).problem;
|
||||
let fresh9 = addr_of_mut!((*parser).problem);
|
||||
*fresh9 = problem;
|
||||
(*parser).problem_mark = problem_mark;
|
||||
0 as libc::c_int
|
||||
|
@ -145,26 +145,26 @@ unsafe fn yaml_parser_set_composer_error_context(
|
|||
problem_mark: yaml_mark_t,
|
||||
) -> libc::c_int {
|
||||
(*parser).error = YAML_COMPOSER_ERROR;
|
||||
let fresh10 = &mut (*parser).context;
|
||||
let fresh10 = addr_of_mut!((*parser).context);
|
||||
*fresh10 = context;
|
||||
(*parser).context_mark = context_mark;
|
||||
let fresh11 = &mut (*parser).problem;
|
||||
let fresh11 = addr_of_mut!((*parser).problem);
|
||||
*fresh11 = problem;
|
||||
(*parser).problem_mark = problem_mark;
|
||||
0 as libc::c_int
|
||||
}
|
||||
unsafe fn yaml_parser_delete_aliases(parser: *mut yaml_parser_t) {
|
||||
while !((*parser).aliases.start == (*parser).aliases.top) {
|
||||
let fresh12 = &mut (*parser).aliases.top;
|
||||
let fresh12 = addr_of_mut!((*parser).aliases.top);
|
||||
*fresh12 = (*fresh12).c_offset(-1);
|
||||
yaml_free((**fresh12).anchor as *mut libc::c_void);
|
||||
}
|
||||
yaml_free((*parser).aliases.start as *mut libc::c_void);
|
||||
let fresh13 = &mut (*parser).aliases.end;
|
||||
let fresh13 = addr_of_mut!((*parser).aliases.end);
|
||||
*fresh13 = ptr::null_mut::<yaml_alias_data_t>();
|
||||
let fresh14 = &mut (*parser).aliases.top;
|
||||
let fresh14 = addr_of_mut!((*parser).aliases.top);
|
||||
*fresh14 = *fresh13;
|
||||
let fresh15 = &mut (*parser).aliases.start;
|
||||
let fresh15 = addr_of_mut!((*parser).aliases.start);
|
||||
*fresh15 = *fresh14;
|
||||
}
|
||||
unsafe fn yaml_parser_load_document(
|
||||
|
@ -179,11 +179,11 @@ unsafe fn yaml_parser_load_document(
|
|||
__assert!(
|
||||
(*event).type_0 as libc::c_uint == YAML_DOCUMENT_START_EVENT as libc::c_int as libc::c_uint
|
||||
);
|
||||
let fresh16 = &mut (*(*parser).document).version_directive;
|
||||
let fresh16 = addr_of_mut!((*(*parser).document).version_directive);
|
||||
*fresh16 = (*event).data.document_start.version_directive;
|
||||
let fresh17 = &mut (*(*parser).document).tag_directives.start;
|
||||
let fresh17 = addr_of_mut!((*(*parser).document).tag_directives.start);
|
||||
*fresh17 = (*event).data.document_start.tag_directives.start;
|
||||
let fresh18 = &mut (*(*parser).document).tag_directives.end;
|
||||
let fresh18 = addr_of_mut!((*(*parser).document).tag_directives.end);
|
||||
*fresh18 = (*event).data.document_start.tag_directives.end;
|
||||
(*(*parser).document).start_implicit = (*event).data.document_start.implicit;
|
||||
(*(*parser).document).start_mark = (*event).start_mark;
|
||||
|
@ -202,7 +202,7 @@ unsafe fn yaml_parser_load_document(
|
|||
{
|
||||
return 0 as libc::c_int;
|
||||
}
|
||||
if yaml_parser_load_nodes(parser, &mut ctx) == 0 {
|
||||
if yaml_parser_load_nodes(parser, addr_of_mut!(ctx)) == 0 {
|
||||
yaml_free(ctx.start as *mut libc::c_void);
|
||||
ctx.end = ptr::null_mut::<libc::c_int>();
|
||||
ctx.top = ctx.end;
|
||||
|
@ -319,7 +319,7 @@ unsafe fn yaml_parser_register_anchor(
|
|||
addr_of_mut!((*parser).aliases.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh19 = &mut (*parser).aliases.top;
|
||||
let fresh19 = addr_of_mut!((*parser).aliases.top);
|
||||
let fresh20 = *fresh19;
|
||||
*fresh19 = (*fresh19).c_offset(1);
|
||||
*fresh20 = data;
|
||||
|
@ -369,7 +369,7 @@ unsafe fn yaml_parser_load_node_add(
|
|||
addr_of_mut!((*parent).data.sequence.items.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh21 = &mut (*parent).data.sequence.items.top;
|
||||
let fresh21 = addr_of_mut!((*parent).data.sequence.items.top);
|
||||
let fresh22 = *fresh21;
|
||||
*fresh21 = (*fresh21).c_offset(1);
|
||||
*fresh22 = index;
|
||||
|
@ -424,7 +424,7 @@ unsafe fn yaml_parser_load_node_add(
|
|||
as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh23 = &mut (*parent).data.mapping.pairs.top;
|
||||
let fresh23 = addr_of_mut!((*parent).data.mapping.pairs.top);
|
||||
let fresh24 = *fresh23;
|
||||
*fresh23 = (*fresh23).c_offset(1);
|
||||
*fresh24 = pair;
|
||||
|
@ -550,7 +550,7 @@ unsafe fn yaml_parser_load_scalar(
|
|||
addr_of_mut!((*(*parser).document).nodes.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh25 = &mut (*(*parser).document).nodes.top;
|
||||
let fresh25 = addr_of_mut!((*(*parser).document).nodes.top);
|
||||
let fresh26 = *fresh25;
|
||||
*fresh25 = (*fresh25).c_offset(1);
|
||||
*fresh26 = node;
|
||||
|
@ -678,7 +678,7 @@ unsafe fn yaml_parser_load_sequence(
|
|||
addr_of_mut!((*(*parser).document).nodes.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh27 = &mut (*(*parser).document).nodes.top;
|
||||
let fresh27 = addr_of_mut!((*(*parser).document).nodes.top);
|
||||
let fresh28 = *fresh27;
|
||||
*fresh27 = (*fresh27).c_offset(1);
|
||||
*fresh28 = node;
|
||||
|
@ -720,7 +720,7 @@ unsafe fn yaml_parser_load_sequence(
|
|||
addr_of_mut!((*ctx).end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh29 = &mut (*ctx).top;
|
||||
let fresh29 = addr_of_mut!((*ctx).top);
|
||||
let fresh30 = *fresh29;
|
||||
*fresh29 = (*fresh29).c_offset(1);
|
||||
*fresh30 = index;
|
||||
|
@ -758,7 +758,7 @@ unsafe fn yaml_parser_load_sequence_end(
|
|||
);
|
||||
(*((*(*parser).document).nodes.start).c_offset((index - 1 as libc::c_int) as isize)).end_mark =
|
||||
(*event).end_mark;
|
||||
let fresh31 = &mut (*ctx).top;
|
||||
let fresh31 = addr_of_mut!((*ctx).top);
|
||||
*fresh31 = (*fresh31).c_offset(-1);
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ unsafe fn yaml_parser_load_mapping(
|
|||
addr_of_mut!((*(*parser).document).nodes.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh32 = &mut (*(*parser).document).nodes.top;
|
||||
let fresh32 = addr_of_mut!((*(*parser).document).nodes.top);
|
||||
let fresh33 = *fresh32;
|
||||
*fresh32 = (*fresh32).c_offset(1);
|
||||
*fresh33 = node;
|
||||
|
@ -905,7 +905,7 @@ unsafe fn yaml_parser_load_mapping(
|
|||
addr_of_mut!((*ctx).end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh34 = &mut (*ctx).top;
|
||||
let fresh34 = addr_of_mut!((*ctx).top);
|
||||
let fresh35 = *fresh34;
|
||||
*fresh34 = (*fresh34).c_offset(1);
|
||||
*fresh35 = index;
|
||||
|
@ -943,7 +943,7 @@ unsafe fn yaml_parser_load_mapping_end(
|
|||
);
|
||||
(*((*(*parser).document).nodes.start).c_offset((index - 1 as libc::c_int) as isize)).end_mark =
|
||||
(*event).end_mark;
|
||||
let fresh36 = &mut (*ctx).top;
|
||||
let fresh36 = addr_of_mut!((*ctx).top);
|
||||
*fresh36 = (*fresh36).c_offset(-1);
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
|
262
src/parser.rs
262
src/parser.rs
|
@ -68,7 +68,7 @@ unsafe fn yaml_parser_set_parser_error(
|
|||
problem_mark: yaml_mark_t,
|
||||
) -> libc::c_int {
|
||||
(*parser).error = YAML_PARSER_ERROR;
|
||||
let fresh0 = &mut (*parser).problem;
|
||||
let fresh0 = addr_of_mut!((*parser).problem);
|
||||
*fresh0 = problem;
|
||||
(*parser).problem_mark = problem_mark;
|
||||
0 as libc::c_int
|
||||
|
@ -81,10 +81,10 @@ unsafe fn yaml_parser_set_parser_error_context(
|
|||
problem_mark: yaml_mark_t,
|
||||
) -> libc::c_int {
|
||||
(*parser).error = YAML_PARSER_ERROR;
|
||||
let fresh1 = &mut (*parser).context;
|
||||
let fresh1 = addr_of_mut!((*parser).context);
|
||||
*fresh1 = context;
|
||||
(*parser).context_mark = context_mark;
|
||||
let fresh2 = &mut (*parser).problem;
|
||||
let fresh2 = addr_of_mut!((*parser).problem);
|
||||
*fresh2 = problem;
|
||||
(*parser).problem_mark = problem_mark;
|
||||
0 as libc::c_int
|
||||
|
@ -170,12 +170,12 @@ unsafe fn yaml_parser_parse_stream_start(
|
|||
(*event).end_mark = (*token).start_mark;
|
||||
(*event).data.stream_start.encoding = (*token).data.stream_start.encoding;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh3 = &mut (*parser).tokens_parsed;
|
||||
let fresh3 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh3 = (*fresh3).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh4 = &mut (*parser).tokens.head;
|
||||
let fresh4 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh4 = (*fresh4).c_offset(1);
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
@ -204,12 +204,12 @@ unsafe fn yaml_parser_parse_document_start(
|
|||
== YAML_DOCUMENT_END_TOKEN as libc::c_int as libc::c_uint
|
||||
{
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh5 = &mut (*parser).tokens_parsed;
|
||||
let fresh5 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh5 = (*fresh5).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh6 = &mut (*parser).tokens.head;
|
||||
let fresh6 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh6 = (*fresh6).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0
|
||||
{
|
||||
|
@ -247,7 +247,7 @@ unsafe fn yaml_parser_parse_document_start(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh7 = &mut (*parser).states.top;
|
||||
let fresh7 = addr_of_mut!((*parser).states.top);
|
||||
let fresh8 = *fresh7;
|
||||
*fresh7 = (*fresh7).c_offset(1);
|
||||
*fresh8 = YAML_PARSE_DOCUMENT_END_STATE;
|
||||
|
@ -268,11 +268,11 @@ unsafe fn yaml_parser_parse_document_start(
|
|||
(*event).type_0 = YAML_DOCUMENT_START_EVENT;
|
||||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).start_mark;
|
||||
let fresh9 = &mut (*event).data.document_start.version_directive;
|
||||
let fresh9 = addr_of_mut!((*event).data.document_start.version_directive);
|
||||
*fresh9 = ptr::null_mut::<yaml_version_directive_t>();
|
||||
let fresh10 = &mut (*event).data.document_start.tag_directives.start;
|
||||
let fresh10 = addr_of_mut!((*event).data.document_start.tag_directives.start);
|
||||
*fresh10 = ptr::null_mut::<yaml_tag_directive_t>();
|
||||
let fresh11 = &mut (*event).data.document_start.tag_directives.end;
|
||||
let fresh11 = addr_of_mut!((*event).data.document_start.tag_directives.end);
|
||||
*fresh11 = ptr::null_mut::<yaml_tag_directive_t>();
|
||||
(*event).data.document_start.implicit = 1 as libc::c_int;
|
||||
1 as libc::c_int
|
||||
|
@ -283,9 +283,9 @@ unsafe fn yaml_parser_parse_document_start(
|
|||
let start_mark: yaml_mark_t = (*token).start_mark;
|
||||
if yaml_parser_process_directives(
|
||||
parser,
|
||||
&mut version_directive,
|
||||
&mut tag_directives.start,
|
||||
&mut tag_directives.end,
|
||||
addr_of_mut!(version_directive),
|
||||
addr_of_mut!(tag_directives.start),
|
||||
addr_of_mut!(tag_directives.end),
|
||||
) == 0
|
||||
{
|
||||
return 0 as libc::c_int;
|
||||
|
@ -311,7 +311,7 @@ unsafe fn yaml_parser_parse_document_start(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh12 = &mut (*parser).states.top;
|
||||
let fresh12 = addr_of_mut!((*parser).states.top);
|
||||
let fresh13 = *fresh12;
|
||||
*fresh12 = (*fresh12).c_offset(1);
|
||||
*fresh13 = YAML_PARSE_DOCUMENT_END_STATE;
|
||||
|
@ -331,20 +331,20 @@ unsafe fn yaml_parser_parse_document_start(
|
|||
(*event).type_0 = YAML_DOCUMENT_START_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh14 = &mut (*event).data.document_start.version_directive;
|
||||
let fresh14 = addr_of_mut!((*event).data.document_start.version_directive);
|
||||
*fresh14 = version_directive;
|
||||
let fresh15 = &mut (*event).data.document_start.tag_directives.start;
|
||||
let fresh15 = addr_of_mut!((*event).data.document_start.tag_directives.start);
|
||||
*fresh15 = tag_directives.start;
|
||||
let fresh16 = &mut (*event).data.document_start.tag_directives.end;
|
||||
let fresh16 = addr_of_mut!((*event).data.document_start.tag_directives.end);
|
||||
*fresh16 = tag_directives.end;
|
||||
(*event).data.document_start.implicit = 0 as libc::c_int;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh17 = &mut (*parser).tokens_parsed;
|
||||
let fresh17 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh17 = (*fresh17).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh18 = &mut (*parser).tokens.head;
|
||||
let fresh18 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh18 = (*fresh18).c_offset(1);
|
||||
tag_directives.end = ptr::null_mut::<yaml_tag_directive_t>();
|
||||
tag_directives.start = tag_directives.end;
|
||||
|
@ -376,12 +376,12 @@ unsafe fn yaml_parser_parse_document_start(
|
|||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh19 = &mut (*parser).tokens_parsed;
|
||||
let fresh19 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh19 = (*fresh19).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh20 = &mut (*parser).tokens.head;
|
||||
let fresh20 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh20 = (*fresh20).c_offset(1);
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ unsafe fn yaml_parser_parse_document_content(
|
|||
|| (*token).type_0 as libc::c_uint == YAML_DOCUMENT_END_TOKEN as libc::c_int as libc::c_uint
|
||||
|| (*token).type_0 as libc::c_uint == YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint
|
||||
{
|
||||
let fresh21 = &mut (*parser).states.top;
|
||||
let fresh21 = addr_of_mut!((*parser).states.top);
|
||||
*fresh21 = (*fresh21).c_offset(-1);
|
||||
(*parser).state = **fresh21;
|
||||
yaml_parser_process_empty_scalar(parser, event, (*token).start_mark)
|
||||
|
@ -436,17 +436,17 @@ unsafe fn yaml_parser_parse_document_end(
|
|||
if (*token).type_0 as libc::c_uint == YAML_DOCUMENT_END_TOKEN as libc::c_int as libc::c_uint {
|
||||
end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh22 = &mut (*parser).tokens_parsed;
|
||||
let fresh22 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh22 = (*fresh22).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh23 = &mut (*parser).tokens.head;
|
||||
let fresh23 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh23 = (*fresh23).c_offset(1);
|
||||
implicit = 0 as libc::c_int;
|
||||
}
|
||||
while !((*parser).tag_directives.start == (*parser).tag_directives.top) {
|
||||
let fresh24 = &mut (*parser).tag_directives.top;
|
||||
let fresh24 = addr_of_mut!((*parser).tag_directives.top);
|
||||
*fresh24 = (*fresh24).c_offset(-1);
|
||||
let tag_directive: yaml_tag_directive_t = **fresh24;
|
||||
yaml_free(tag_directive.handle as *mut libc::c_void);
|
||||
|
@ -493,7 +493,7 @@ unsafe fn yaml_parser_parse_node(
|
|||
return 0 as libc::c_int;
|
||||
}
|
||||
if (*token).type_0 as libc::c_uint == YAML_ALIAS_TOKEN as libc::c_int as libc::c_uint {
|
||||
let fresh25 = &mut (*parser).states.top;
|
||||
let fresh25 = addr_of_mut!((*parser).states.top);
|
||||
*fresh25 = (*fresh25).c_offset(-1);
|
||||
(*parser).state = **fresh25;
|
||||
memset(
|
||||
|
@ -504,15 +504,15 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_ALIAS_EVENT;
|
||||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).end_mark;
|
||||
let fresh26 = &mut (*event).data.alias.anchor;
|
||||
let fresh26 = addr_of_mut!((*event).data.alias.anchor);
|
||||
*fresh26 = (*token).data.alias.value;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh27 = &mut (*parser).tokens_parsed;
|
||||
let fresh27 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh27 = (*fresh27).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh28 = &mut (*parser).tokens.head;
|
||||
let fresh28 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh28 = (*fresh28).c_offset(1);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
@ -523,12 +523,12 @@ unsafe fn yaml_parser_parse_node(
|
|||
start_mark = (*token).start_mark;
|
||||
end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh29 = &mut (*parser).tokens_parsed;
|
||||
let fresh29 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh29 = (*fresh29).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh30 = &mut (*parser).tokens.head;
|
||||
let fresh30 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh30 = (*fresh30).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0
|
||||
{
|
||||
|
@ -546,12 +546,12 @@ unsafe fn yaml_parser_parse_node(
|
|||
tag_mark = (*token).start_mark;
|
||||
end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh31 = &mut (*parser).tokens_parsed;
|
||||
let fresh31 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh31 = (*fresh31).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh32 = &mut (*parser).tokens.head;
|
||||
let fresh32 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh32 = (*fresh32).c_offset(1);
|
||||
token = if (*parser).token_available != 0
|
||||
|| yaml_parser_fetch_more_tokens(parser) != 0
|
||||
|
@ -575,12 +575,12 @@ unsafe fn yaml_parser_parse_node(
|
|||
start_mark = tag_mark;
|
||||
end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh33 = &mut (*parser).tokens_parsed;
|
||||
let fresh33 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh33 = (*fresh33).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh34 = &mut (*parser).tokens.head;
|
||||
let fresh34 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh34 = (*fresh34).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0
|
||||
{
|
||||
|
@ -596,12 +596,12 @@ unsafe fn yaml_parser_parse_node(
|
|||
anchor = (*token).data.anchor.value;
|
||||
end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh35 = &mut (*parser).tokens_parsed;
|
||||
let fresh35 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh35 = (*fresh35).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh36 = &mut (*parser).tokens.head;
|
||||
let fresh36 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh36 = (*fresh36).c_offset(1);
|
||||
token = if (*parser).token_available != 0
|
||||
|| yaml_parser_fetch_more_tokens(parser) != 0
|
||||
|
@ -720,9 +720,9 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_SEQUENCE_START_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh37 = &mut (*event).data.sequence_start.anchor;
|
||||
let fresh37 = addr_of_mut!((*event).data.sequence_start.anchor);
|
||||
*fresh37 = anchor;
|
||||
let fresh38 = &mut (*event).data.sequence_start.tag;
|
||||
let fresh38 = addr_of_mut!((*event).data.sequence_start.tag);
|
||||
*fresh38 = tag;
|
||||
(*event).data.sequence_start.implicit = implicit;
|
||||
(*event).data.sequence_start.style = YAML_BLOCK_SEQUENCE_STYLE;
|
||||
|
@ -746,7 +746,7 @@ unsafe fn yaml_parser_parse_node(
|
|||
} else if tag.is_null() {
|
||||
quoted_implicit = 1 as libc::c_int;
|
||||
}
|
||||
let fresh39 = &mut (*parser).states.top;
|
||||
let fresh39 = addr_of_mut!((*parser).states.top);
|
||||
*fresh39 = (*fresh39).c_offset(-1);
|
||||
(*parser).state = **fresh39;
|
||||
memset(
|
||||
|
@ -757,24 +757,24 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_SCALAR_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh40 = &mut (*event).data.scalar.anchor;
|
||||
let fresh40 = addr_of_mut!((*event).data.scalar.anchor);
|
||||
*fresh40 = anchor;
|
||||
let fresh41 = &mut (*event).data.scalar.tag;
|
||||
let fresh41 = addr_of_mut!((*event).data.scalar.tag);
|
||||
*fresh41 = tag;
|
||||
let fresh42 = &mut (*event).data.scalar.value;
|
||||
let fresh42 = addr_of_mut!((*event).data.scalar.value);
|
||||
*fresh42 = (*token).data.scalar.value;
|
||||
(*event).data.scalar.length = (*token).data.scalar.length;
|
||||
(*event).data.scalar.plain_implicit = plain_implicit;
|
||||
(*event).data.scalar.quoted_implicit = quoted_implicit;
|
||||
(*event).data.scalar.style = (*token).data.scalar.style;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh43 = &mut (*parser).tokens_parsed;
|
||||
let fresh43 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh43 = (*fresh43).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0
|
||||
as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh44 = &mut (*parser).tokens.head;
|
||||
let fresh44 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh44 = (*fresh44).c_offset(1);
|
||||
return 1 as libc::c_int;
|
||||
} else if (*token).type_0 as libc::c_uint
|
||||
|
@ -790,9 +790,9 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_SEQUENCE_START_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh45 = &mut (*event).data.sequence_start.anchor;
|
||||
let fresh45 = addr_of_mut!((*event).data.sequence_start.anchor);
|
||||
*fresh45 = anchor;
|
||||
let fresh46 = &mut (*event).data.sequence_start.tag;
|
||||
let fresh46 = addr_of_mut!((*event).data.sequence_start.tag);
|
||||
*fresh46 = tag;
|
||||
(*event).data.sequence_start.implicit = implicit;
|
||||
(*event).data.sequence_start.style = YAML_FLOW_SEQUENCE_STYLE;
|
||||
|
@ -810,9 +810,9 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_MAPPING_START_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh47 = &mut (*event).data.mapping_start.anchor;
|
||||
let fresh47 = addr_of_mut!((*event).data.mapping_start.anchor);
|
||||
*fresh47 = anchor;
|
||||
let fresh48 = &mut (*event).data.mapping_start.tag;
|
||||
let fresh48 = addr_of_mut!((*event).data.mapping_start.tag);
|
||||
*fresh48 = tag;
|
||||
(*event).data.mapping_start.implicit = implicit;
|
||||
(*event).data.mapping_start.style = YAML_FLOW_MAPPING_STYLE;
|
||||
|
@ -831,9 +831,9 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_SEQUENCE_START_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh49 = &mut (*event).data.sequence_start.anchor;
|
||||
let fresh49 = addr_of_mut!((*event).data.sequence_start.anchor);
|
||||
*fresh49 = anchor;
|
||||
let fresh50 = &mut (*event).data.sequence_start.tag;
|
||||
let fresh50 = addr_of_mut!((*event).data.sequence_start.tag);
|
||||
*fresh50 = tag;
|
||||
(*event).data.sequence_start.implicit = implicit;
|
||||
(*event).data.sequence_start.style = YAML_BLOCK_SEQUENCE_STYLE;
|
||||
|
@ -852,9 +852,9 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_MAPPING_START_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh51 = &mut (*event).data.mapping_start.anchor;
|
||||
let fresh51 = addr_of_mut!((*event).data.mapping_start.anchor);
|
||||
*fresh51 = anchor;
|
||||
let fresh52 = &mut (*event).data.mapping_start.tag;
|
||||
let fresh52 = addr_of_mut!((*event).data.mapping_start.tag);
|
||||
*fresh52 = tag;
|
||||
(*event).data.mapping_start.implicit = implicit;
|
||||
(*event).data.mapping_start.style = YAML_BLOCK_MAPPING_STYLE;
|
||||
|
@ -867,7 +867,7 @@ unsafe fn yaml_parser_parse_node(
|
|||
} else {
|
||||
*value.c_offset(0 as libc::c_int as isize) =
|
||||
'\0' as i32 as yaml_char_t;
|
||||
let fresh53 = &mut (*parser).states.top;
|
||||
let fresh53 = addr_of_mut!((*parser).states.top);
|
||||
*fresh53 = (*fresh53).c_offset(-1);
|
||||
(*parser).state = **fresh53;
|
||||
memset(
|
||||
|
@ -878,11 +878,11 @@ unsafe fn yaml_parser_parse_node(
|
|||
(*event).type_0 = YAML_SCALAR_EVENT;
|
||||
(*event).start_mark = start_mark;
|
||||
(*event).end_mark = end_mark;
|
||||
let fresh54 = &mut (*event).data.scalar.anchor;
|
||||
let fresh54 = addr_of_mut!((*event).data.scalar.anchor);
|
||||
*fresh54 = anchor;
|
||||
let fresh55 = &mut (*event).data.scalar.tag;
|
||||
let fresh55 = addr_of_mut!((*event).data.scalar.tag);
|
||||
*fresh55 = tag;
|
||||
let fresh56 = &mut (*event).data.scalar.value;
|
||||
let fresh56 = addr_of_mut!((*event).data.scalar.value);
|
||||
*fresh56 = value;
|
||||
(*event).data.scalar.length = 0 as libc::c_int as size_t;
|
||||
(*event).data.scalar.plain_implicit = implicit;
|
||||
|
@ -937,7 +937,7 @@ unsafe fn yaml_parser_parse_block_sequence_entry(
|
|||
addr_of_mut!((*parser).marks.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh57 = &mut (*parser).marks.top;
|
||||
let fresh57 = addr_of_mut!((*parser).marks.top);
|
||||
let fresh58 = *fresh57;
|
||||
*fresh57 = (*fresh57).c_offset(1);
|
||||
*fresh58 = (*token).start_mark;
|
||||
|
@ -950,12 +950,12 @@ unsafe fn yaml_parser_parse_block_sequence_entry(
|
|||
return 0 as libc::c_int;
|
||||
}
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh59 = &mut (*parser).tokens_parsed;
|
||||
let fresh59 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh59 = (*fresh59).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh60 = &mut (*parser).tokens.head;
|
||||
let fresh60 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh60 = (*fresh60).c_offset(1);
|
||||
}
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
|
@ -969,12 +969,12 @@ unsafe fn yaml_parser_parse_block_sequence_entry(
|
|||
if (*token).type_0 as libc::c_uint == YAML_BLOCK_ENTRY_TOKEN as libc::c_int as libc::c_uint {
|
||||
let mark: yaml_mark_t = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh61 = &mut (*parser).tokens_parsed;
|
||||
let fresh61 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh61 = (*fresh61).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh62 = &mut (*parser).tokens.head;
|
||||
let fresh62 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh62 = (*fresh62).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
(*parser).tokens.head
|
||||
|
@ -995,7 +995,7 @@ unsafe fn yaml_parser_parse_block_sequence_entry(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh63 = &mut (*parser).states.top;
|
||||
let fresh63 = addr_of_mut!((*parser).states.top);
|
||||
let fresh64 = *fresh63;
|
||||
*fresh63 = (*fresh63).c_offset(1);
|
||||
*fresh64 = YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE;
|
||||
|
@ -1014,10 +1014,10 @@ unsafe fn yaml_parser_parse_block_sequence_entry(
|
|||
}
|
||||
} else if (*token).type_0 as libc::c_uint == YAML_BLOCK_END_TOKEN as libc::c_int as libc::c_uint
|
||||
{
|
||||
let fresh65 = &mut (*parser).states.top;
|
||||
let fresh65 = addr_of_mut!((*parser).states.top);
|
||||
*fresh65 = (*fresh65).c_offset(-1);
|
||||
(*parser).state = **fresh65;
|
||||
let fresh66 = &mut (*parser).marks.top;
|
||||
let fresh66 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh66 = (*fresh66).c_offset(-1);
|
||||
memset(
|
||||
event as *mut libc::c_void,
|
||||
|
@ -1028,16 +1028,16 @@ unsafe fn yaml_parser_parse_block_sequence_entry(
|
|||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh67 = &mut (*parser).tokens_parsed;
|
||||
let fresh67 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh67 = (*fresh67).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh68 = &mut (*parser).tokens.head;
|
||||
let fresh68 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh68 = (*fresh68).c_offset(1);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
let fresh69 = &mut (*parser).marks.top;
|
||||
let fresh69 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh69 = (*fresh69).c_offset(-1);
|
||||
yaml_parser_set_parser_error_context(
|
||||
parser,
|
||||
|
@ -1064,12 +1064,12 @@ unsafe fn yaml_parser_parse_indentless_sequence_entry(
|
|||
if (*token).type_0 as libc::c_uint == YAML_BLOCK_ENTRY_TOKEN as libc::c_int as libc::c_uint {
|
||||
let mark: yaml_mark_t = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh70 = &mut (*parser).tokens_parsed;
|
||||
let fresh70 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh70 = (*fresh70).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh71 = &mut (*parser).tokens.head;
|
||||
let fresh71 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh71 = (*fresh71).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
(*parser).tokens.head
|
||||
|
@ -1092,7 +1092,7 @@ unsafe fn yaml_parser_parse_indentless_sequence_entry(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh72 = &mut (*parser).states.top;
|
||||
let fresh72 = addr_of_mut!((*parser).states.top);
|
||||
let fresh73 = *fresh72;
|
||||
*fresh72 = (*fresh72).c_offset(1);
|
||||
*fresh73 = YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE;
|
||||
|
@ -1110,7 +1110,7 @@ unsafe fn yaml_parser_parse_indentless_sequence_entry(
|
|||
yaml_parser_process_empty_scalar(parser, event, mark)
|
||||
}
|
||||
} else {
|
||||
let fresh74 = &mut (*parser).states.top;
|
||||
let fresh74 = addr_of_mut!((*parser).states.top);
|
||||
*fresh74 = (*fresh74).c_offset(-1);
|
||||
(*parser).state = **fresh74;
|
||||
memset(
|
||||
|
@ -1143,7 +1143,7 @@ unsafe fn yaml_parser_parse_block_mapping_key(
|
|||
addr_of_mut!((*parser).marks.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh75 = &mut (*parser).marks.top;
|
||||
let fresh75 = addr_of_mut!((*parser).marks.top);
|
||||
let fresh76 = *fresh75;
|
||||
*fresh75 = (*fresh75).c_offset(1);
|
||||
*fresh76 = (*token).start_mark;
|
||||
|
@ -1156,12 +1156,12 @@ unsafe fn yaml_parser_parse_block_mapping_key(
|
|||
return 0 as libc::c_int;
|
||||
}
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh77 = &mut (*parser).tokens_parsed;
|
||||
let fresh77 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh77 = (*fresh77).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh78 = &mut (*parser).tokens.head;
|
||||
let fresh78 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh78 = (*fresh78).c_offset(1);
|
||||
}
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
|
@ -1175,12 +1175,12 @@ unsafe fn yaml_parser_parse_block_mapping_key(
|
|||
if (*token).type_0 as libc::c_uint == YAML_KEY_TOKEN as libc::c_int as libc::c_uint {
|
||||
let mark: yaml_mark_t = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh79 = &mut (*parser).tokens_parsed;
|
||||
let fresh79 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh79 = (*fresh79).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh80 = &mut (*parser).tokens.head;
|
||||
let fresh80 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh80 = (*fresh80).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
(*parser).tokens.head
|
||||
|
@ -1202,7 +1202,7 @@ unsafe fn yaml_parser_parse_block_mapping_key(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh81 = &mut (*parser).states.top;
|
||||
let fresh81 = addr_of_mut!((*parser).states.top);
|
||||
let fresh82 = *fresh81;
|
||||
*fresh81 = (*fresh81).c_offset(1);
|
||||
*fresh82 = YAML_PARSE_BLOCK_MAPPING_VALUE_STATE;
|
||||
|
@ -1221,10 +1221,10 @@ unsafe fn yaml_parser_parse_block_mapping_key(
|
|||
}
|
||||
} else if (*token).type_0 as libc::c_uint == YAML_BLOCK_END_TOKEN as libc::c_int as libc::c_uint
|
||||
{
|
||||
let fresh83 = &mut (*parser).states.top;
|
||||
let fresh83 = addr_of_mut!((*parser).states.top);
|
||||
*fresh83 = (*fresh83).c_offset(-1);
|
||||
(*parser).state = **fresh83;
|
||||
let fresh84 = &mut (*parser).marks.top;
|
||||
let fresh84 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh84 = (*fresh84).c_offset(-1);
|
||||
memset(
|
||||
event as *mut libc::c_void,
|
||||
|
@ -1235,16 +1235,16 @@ unsafe fn yaml_parser_parse_block_mapping_key(
|
|||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh85 = &mut (*parser).tokens_parsed;
|
||||
let fresh85 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh85 = (*fresh85).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh86 = &mut (*parser).tokens.head;
|
||||
let fresh86 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh86 = (*fresh86).c_offset(1);
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
let fresh87 = &mut (*parser).marks.top;
|
||||
let fresh87 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh87 = (*fresh87).c_offset(-1);
|
||||
yaml_parser_set_parser_error_context(
|
||||
parser,
|
||||
|
@ -1271,12 +1271,12 @@ unsafe fn yaml_parser_parse_block_mapping_value(
|
|||
if (*token).type_0 as libc::c_uint == YAML_VALUE_TOKEN as libc::c_int as libc::c_uint {
|
||||
let mark: yaml_mark_t = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh88 = &mut (*parser).tokens_parsed;
|
||||
let fresh88 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh88 = (*fresh88).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh89 = &mut (*parser).tokens.head;
|
||||
let fresh89 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh89 = (*fresh89).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
(*parser).tokens.head
|
||||
|
@ -1298,7 +1298,7 @@ unsafe fn yaml_parser_parse_block_mapping_value(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh90 = &mut (*parser).states.top;
|
||||
let fresh90 = addr_of_mut!((*parser).states.top);
|
||||
let fresh91 = *fresh90;
|
||||
*fresh90 = (*fresh90).c_offset(1);
|
||||
*fresh91 = YAML_PARSE_BLOCK_MAPPING_KEY_STATE;
|
||||
|
@ -1339,7 +1339,7 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
addr_of_mut!((*parser).marks.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh92 = &mut (*parser).marks.top;
|
||||
let fresh92 = addr_of_mut!((*parser).marks.top);
|
||||
let fresh93 = *fresh92;
|
||||
*fresh92 = (*fresh92).c_offset(1);
|
||||
*fresh93 = (*token).start_mark;
|
||||
|
@ -1352,12 +1352,12 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
return 0 as libc::c_int;
|
||||
}
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh94 = &mut (*parser).tokens_parsed;
|
||||
let fresh94 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh94 = (*fresh94).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh95 = &mut (*parser).tokens.head;
|
||||
let fresh95 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh95 = (*fresh95).c_offset(1);
|
||||
}
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
|
@ -1376,12 +1376,12 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
== YAML_FLOW_ENTRY_TOKEN as libc::c_int as libc::c_uint
|
||||
{
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh96 = &mut (*parser).tokens_parsed;
|
||||
let fresh96 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh96 = (*fresh96).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh97 = &mut (*parser).tokens.head;
|
||||
let fresh97 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh97 = (*fresh97).c_offset(1);
|
||||
token = if (*parser).token_available != 0
|
||||
|| yaml_parser_fetch_more_tokens(parser) != 0
|
||||
|
@ -1394,7 +1394,7 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
return 0 as libc::c_int;
|
||||
}
|
||||
} else {
|
||||
let fresh98 = &mut (*parser).marks.top;
|
||||
let fresh98 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh98 = (*fresh98).c_offset(-1);
|
||||
return yaml_parser_set_parser_error_context(
|
||||
parser,
|
||||
|
@ -1415,19 +1415,19 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
(*event).type_0 = YAML_MAPPING_START_EVENT;
|
||||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).end_mark;
|
||||
let fresh99 = &mut (*event).data.mapping_start.anchor;
|
||||
let fresh99 = addr_of_mut!((*event).data.mapping_start.anchor);
|
||||
*fresh99 = ptr::null_mut::<yaml_char_t>();
|
||||
let fresh100 = &mut (*event).data.mapping_start.tag;
|
||||
let fresh100 = addr_of_mut!((*event).data.mapping_start.tag);
|
||||
*fresh100 = ptr::null_mut::<yaml_char_t>();
|
||||
(*event).data.mapping_start.implicit = 1 as libc::c_int;
|
||||
(*event).data.mapping_start.style = YAML_FLOW_MAPPING_STYLE;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh101 = &mut (*parser).tokens_parsed;
|
||||
let fresh101 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh101 = (*fresh101).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh102 = &mut (*parser).tokens.head;
|
||||
let fresh102 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh102 = (*fresh102).c_offset(1);
|
||||
return 1 as libc::c_int;
|
||||
} else if (*token).type_0 as libc::c_uint
|
||||
|
@ -1440,7 +1440,7 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh103 = &mut (*parser).states.top;
|
||||
let fresh103 = addr_of_mut!((*parser).states.top);
|
||||
let fresh104 = *fresh103;
|
||||
*fresh103 = (*fresh103).c_offset(1);
|
||||
*fresh104 = YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE;
|
||||
|
@ -1455,10 +1455,10 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
return yaml_parser_parse_node(parser, event, 0 as libc::c_int, 0 as libc::c_int);
|
||||
}
|
||||
}
|
||||
let fresh105 = &mut (*parser).states.top;
|
||||
let fresh105 = addr_of_mut!((*parser).states.top);
|
||||
*fresh105 = (*fresh105).c_offset(-1);
|
||||
(*parser).state = **fresh105;
|
||||
let fresh106 = &mut (*parser).marks.top;
|
||||
let fresh106 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh106 = (*fresh106).c_offset(-1);
|
||||
memset(
|
||||
event as *mut libc::c_void,
|
||||
|
@ -1469,12 +1469,12 @@ unsafe fn yaml_parser_parse_flow_sequence_entry(
|
|||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh107 = &mut (*parser).tokens_parsed;
|
||||
let fresh107 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh107 = (*fresh107).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh108 = &mut (*parser).tokens.head;
|
||||
let fresh108 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh108 = (*fresh108).c_offset(1);
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
@ -1503,7 +1503,7 @@ unsafe fn yaml_parser_parse_flow_sequence_entry_mapping_key(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh109 = &mut (*parser).states.top;
|
||||
let fresh109 = addr_of_mut!((*parser).states.top);
|
||||
let fresh110 = *fresh109;
|
||||
*fresh109 = (*fresh109).c_offset(1);
|
||||
*fresh110 = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE;
|
||||
|
@ -1519,12 +1519,12 @@ unsafe fn yaml_parser_parse_flow_sequence_entry_mapping_key(
|
|||
} else {
|
||||
let mark: yaml_mark_t = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh111 = &mut (*parser).tokens_parsed;
|
||||
let fresh111 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh111 = (*fresh111).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh112 = &mut (*parser).tokens.head;
|
||||
let fresh112 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh112 = (*fresh112).c_offset(1);
|
||||
(*parser).state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE;
|
||||
yaml_parser_process_empty_scalar(parser, event, mark)
|
||||
|
@ -1545,12 +1545,12 @@ unsafe fn yaml_parser_parse_flow_sequence_entry_mapping_value(
|
|||
}
|
||||
if (*token).type_0 as libc::c_uint == YAML_VALUE_TOKEN as libc::c_int as libc::c_uint {
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh113 = &mut (*parser).tokens_parsed;
|
||||
let fresh113 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh113 = (*fresh113).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh114 = &mut (*parser).tokens.head;
|
||||
let fresh114 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh114 = (*fresh114).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
(*parser).tokens.head
|
||||
|
@ -1571,7 +1571,7 @@ unsafe fn yaml_parser_parse_flow_sequence_entry_mapping_value(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh115 = &mut (*parser).states.top;
|
||||
let fresh115 = addr_of_mut!((*parser).states.top);
|
||||
let fresh116 = *fresh115;
|
||||
*fresh115 = (*fresh115).c_offset(1);
|
||||
*fresh116 = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE;
|
||||
|
@ -1632,7 +1632,7 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
addr_of_mut!((*parser).marks.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh117 = &mut (*parser).marks.top;
|
||||
let fresh117 = addr_of_mut!((*parser).marks.top);
|
||||
let fresh118 = *fresh117;
|
||||
*fresh117 = (*fresh117).c_offset(1);
|
||||
*fresh118 = (*token).start_mark;
|
||||
|
@ -1645,12 +1645,12 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
return 0 as libc::c_int;
|
||||
}
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh119 = &mut (*parser).tokens_parsed;
|
||||
let fresh119 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh119 = (*fresh119).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh120 = &mut (*parser).tokens.head;
|
||||
let fresh120 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh120 = (*fresh120).c_offset(1);
|
||||
}
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
|
@ -1668,12 +1668,12 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
== YAML_FLOW_ENTRY_TOKEN as libc::c_int as libc::c_uint
|
||||
{
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh121 = &mut (*parser).tokens_parsed;
|
||||
let fresh121 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh121 = (*fresh121).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh122 = &mut (*parser).tokens.head;
|
||||
let fresh122 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh122 = (*fresh122).c_offset(1);
|
||||
token = if (*parser).token_available != 0
|
||||
|| yaml_parser_fetch_more_tokens(parser) != 0
|
||||
|
@ -1686,7 +1686,7 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
return 0 as libc::c_int;
|
||||
}
|
||||
} else {
|
||||
let fresh123 = &mut (*parser).marks.top;
|
||||
let fresh123 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh123 = (*fresh123).c_offset(-1);
|
||||
return yaml_parser_set_parser_error_context(
|
||||
parser,
|
||||
|
@ -1699,12 +1699,12 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
}
|
||||
if (*token).type_0 as libc::c_uint == YAML_KEY_TOKEN as libc::c_int as libc::c_uint {
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh124 = &mut (*parser).tokens_parsed;
|
||||
let fresh124 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh124 = (*fresh124).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh125 = &mut (*parser).tokens.head;
|
||||
let fresh125 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh125 = (*fresh125).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0
|
||||
{
|
||||
|
@ -1728,7 +1728,7 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh126 = &mut (*parser).states.top;
|
||||
let fresh126 = addr_of_mut!((*parser).states.top);
|
||||
let fresh127 = *fresh126;
|
||||
*fresh126 = (*fresh126).c_offset(1);
|
||||
*fresh127 = YAML_PARSE_FLOW_MAPPING_VALUE_STATE;
|
||||
|
@ -1755,7 +1755,7 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh128 = &mut (*parser).states.top;
|
||||
let fresh128 = addr_of_mut!((*parser).states.top);
|
||||
let fresh129 = *fresh128;
|
||||
*fresh128 = (*fresh128).c_offset(1);
|
||||
*fresh129 = YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE;
|
||||
|
@ -1770,10 +1770,10 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
return yaml_parser_parse_node(parser, event, 0 as libc::c_int, 0 as libc::c_int);
|
||||
}
|
||||
}
|
||||
let fresh130 = &mut (*parser).states.top;
|
||||
let fresh130 = addr_of_mut!((*parser).states.top);
|
||||
*fresh130 = (*fresh130).c_offset(-1);
|
||||
(*parser).state = **fresh130;
|
||||
let fresh131 = &mut (*parser).marks.top;
|
||||
let fresh131 = addr_of_mut!((*parser).marks.top);
|
||||
*fresh131 = (*fresh131).c_offset(-1);
|
||||
memset(
|
||||
event as *mut libc::c_void,
|
||||
|
@ -1784,12 +1784,12 @@ unsafe fn yaml_parser_parse_flow_mapping_key(
|
|||
(*event).start_mark = (*token).start_mark;
|
||||
(*event).end_mark = (*token).end_mark;
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh132 = &mut (*parser).tokens_parsed;
|
||||
let fresh132 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh132 = (*fresh132).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh133 = &mut (*parser).tokens.head;
|
||||
let fresh133 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh133 = (*fresh133).c_offset(1);
|
||||
1 as libc::c_int
|
||||
}
|
||||
|
@ -1813,12 +1813,12 @@ unsafe fn yaml_parser_parse_flow_mapping_value(
|
|||
}
|
||||
if (*token).type_0 as libc::c_uint == YAML_VALUE_TOKEN as libc::c_int as libc::c_uint {
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh134 = &mut (*parser).tokens_parsed;
|
||||
let fresh134 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh134 = (*fresh134).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh135 = &mut (*parser).tokens.head;
|
||||
let fresh135 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh135 = (*fresh135).c_offset(1);
|
||||
token = if (*parser).token_available != 0 || yaml_parser_fetch_more_tokens(parser) != 0 {
|
||||
(*parser).tokens.head
|
||||
|
@ -1839,7 +1839,7 @@ unsafe fn yaml_parser_parse_flow_mapping_value(
|
|||
addr_of_mut!((*parser).states.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh136 = &mut (*parser).states.top;
|
||||
let fresh136 = addr_of_mut!((*parser).states.top);
|
||||
let fresh137 = *fresh136;
|
||||
*fresh136 = (*fresh136).c_offset(1);
|
||||
*fresh137 = YAML_PARSE_FLOW_MAPPING_KEY_STATE;
|
||||
|
@ -1876,11 +1876,11 @@ unsafe fn yaml_parser_process_empty_scalar(
|
|||
(*event).type_0 = YAML_SCALAR_EVENT;
|
||||
(*event).start_mark = mark;
|
||||
(*event).end_mark = mark;
|
||||
let fresh138 = &mut (*event).data.scalar.anchor;
|
||||
let fresh138 = addr_of_mut!((*event).data.scalar.anchor);
|
||||
*fresh138 = ptr::null_mut::<yaml_char_t>();
|
||||
let fresh139 = &mut (*event).data.scalar.tag;
|
||||
let fresh139 = addr_of_mut!((*event).data.scalar.tag);
|
||||
*fresh139 = ptr::null_mut::<yaml_char_t>();
|
||||
let fresh140 = &mut (*event).data.scalar.value;
|
||||
let fresh140 = addr_of_mut!((*event).data.scalar.value);
|
||||
*fresh140 = value;
|
||||
(*event).data.scalar.length = 0 as libc::c_int as size_t;
|
||||
(*event).data.scalar.plain_implicit = 1 as libc::c_int;
|
||||
|
@ -2023,12 +2023,12 @@ unsafe fn yaml_parser_process_directives(
|
|||
}
|
||||
}
|
||||
(*parser).token_available = 0 as libc::c_int;
|
||||
let fresh142 = &mut (*parser).tokens_parsed;
|
||||
let fresh142 = addr_of_mut!((*parser).tokens_parsed);
|
||||
*fresh142 = (*fresh142).wrapping_add(1);
|
||||
(*parser).stream_end_produced = ((*(*parser).tokens.head).type_0 as libc::c_uint
|
||||
== YAML_STREAM_END_TOKEN as libc::c_int as libc::c_uint)
|
||||
as libc::c_int;
|
||||
let fresh143 = &mut (*parser).tokens.head;
|
||||
let fresh143 = addr_of_mut!((*parser).tokens.head);
|
||||
*fresh143 = (*fresh143).c_offset(1);
|
||||
token = if (*parser).token_available != 0
|
||||
|| yaml_parser_fetch_more_tokens(parser) != 0
|
||||
|
@ -2151,7 +2151,7 @@ unsafe fn yaml_parser_append_tag_directive(
|
|||
addr_of_mut!((*parser).tag_directives.end) as *mut *mut libc::c_void,
|
||||
) != 0
|
||||
{
|
||||
let fresh144 = &mut (*parser).tag_directives.top;
|
||||
let fresh144 = addr_of_mut!((*parser).tag_directives.top);
|
||||
let fresh145 = *fresh144;
|
||||
*fresh144 = (*fresh144).c_offset(1);
|
||||
*fresh145 = copy;
|
||||
|
|
|
@ -3,6 +3,7 @@ use crate::{
|
|||
libc, size_t, yaml_char_t, yaml_parser_t, PointerExt, YAML_READER_ERROR, YAML_UTF16BE_ENCODING,
|
||||
YAML_UTF16LE_ENCODING, YAML_UTF8_ENCODING,
|
||||
};
|
||||
use std::ptr::addr_of_mut;
|
||||
unsafe fn yaml_parser_set_reader_error(
|
||||
mut parser: *mut yaml_parser_t,
|
||||
problem: *const libc::c_char,
|
||||
|
@ -10,7 +11,7 @@ unsafe fn yaml_parser_set_reader_error(
|
|||
value: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
(*parser).error = YAML_READER_ERROR;
|
||||
let fresh0 = &mut (*parser).problem;
|
||||
let fresh0 = addr_of_mut!((*parser).problem);
|
||||
*fresh0 = problem;
|
||||
(*parser).problem_offset = offset;
|
||||
(*parser).problem_value = value;
|
||||
|
@ -34,9 +35,9 @@ unsafe fn yaml_parser_determine_encoding(mut parser: *mut yaml_parser_t) -> libc
|
|||
) == 0
|
||||
{
|
||||
(*parser).encoding = YAML_UTF16LE_ENCODING;
|
||||
let fresh1 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh1 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh1 = (*fresh1).c_offset(2 as libc::c_int as isize);
|
||||
let fresh2 = &mut (*parser).offset;
|
||||
let fresh2 = addr_of_mut!((*parser).offset);
|
||||
*fresh2 = (*fresh2 as libc::c_ulong).wrapping_add(2 as libc::c_int as libc::c_ulong)
|
||||
as size_t as size_t;
|
||||
} else if ((*parser).raw_buffer.last).c_offset_from((*parser).raw_buffer.pointer)
|
||||
|
@ -49,9 +50,9 @@ unsafe fn yaml_parser_determine_encoding(mut parser: *mut yaml_parser_t) -> libc
|
|||
) == 0
|
||||
{
|
||||
(*parser).encoding = YAML_UTF16BE_ENCODING;
|
||||
let fresh3 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh3 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh3 = (*fresh3).c_offset(2 as libc::c_int as isize);
|
||||
let fresh4 = &mut (*parser).offset;
|
||||
let fresh4 = addr_of_mut!((*parser).offset);
|
||||
*fresh4 = (*fresh4 as libc::c_ulong).wrapping_add(2 as libc::c_int as libc::c_ulong)
|
||||
as size_t as size_t;
|
||||
} else if ((*parser).raw_buffer.last).c_offset_from((*parser).raw_buffer.pointer)
|
||||
|
@ -64,9 +65,9 @@ unsafe fn yaml_parser_determine_encoding(mut parser: *mut yaml_parser_t) -> libc
|
|||
) == 0
|
||||
{
|
||||
(*parser).encoding = YAML_UTF8_ENCODING;
|
||||
let fresh5 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh5 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh5 = (*fresh5).c_offset(3 as libc::c_int as isize);
|
||||
let fresh6 = &mut (*parser).offset;
|
||||
let fresh6 = addr_of_mut!((*parser).offset);
|
||||
*fresh6 = (*fresh6 as libc::c_ulong).wrapping_add(3 as libc::c_int as libc::c_ulong)
|
||||
as size_t as size_t;
|
||||
} else {
|
||||
|
@ -94,19 +95,19 @@ unsafe fn yaml_parser_update_raw_buffer(mut parser: *mut yaml_parser_t) -> libc:
|
|||
as libc::c_ulong,
|
||||
);
|
||||
}
|
||||
let fresh7 = &mut (*parser).raw_buffer.last;
|
||||
let fresh7 = addr_of_mut!((*parser).raw_buffer.last);
|
||||
*fresh7 = (*fresh7).c_offset(
|
||||
-(((*parser).raw_buffer.pointer).c_offset_from((*parser).raw_buffer.start) as libc::c_long
|
||||
as isize),
|
||||
);
|
||||
let fresh8 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh8 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh8 = (*parser).raw_buffer.start;
|
||||
if ((*parser).read_handler).expect("non-null function pointer")(
|
||||
(*parser).read_handler_data,
|
||||
(*parser).raw_buffer.last,
|
||||
((*parser).raw_buffer.end).c_offset_from((*parser).raw_buffer.last) as libc::c_long
|
||||
as size_t,
|
||||
&mut size_read,
|
||||
addr_of_mut!(size_read),
|
||||
) == 0
|
||||
{
|
||||
return yaml_parser_set_reader_error(
|
||||
|
@ -116,7 +117,7 @@ unsafe fn yaml_parser_update_raw_buffer(mut parser: *mut yaml_parser_t) -> libc:
|
|||
-(1 as libc::c_int),
|
||||
);
|
||||
}
|
||||
let fresh9 = &mut (*parser).raw_buffer.last;
|
||||
let fresh9 = addr_of_mut!((*parser).raw_buffer.last);
|
||||
*fresh9 = (*fresh9).c_offset(size_read as isize);
|
||||
if size_read == 0 {
|
||||
(*parser).eof = 1 as libc::c_int;
|
||||
|
@ -147,14 +148,14 @@ pub unsafe fn yaml_parser_update_buffer(parser: *mut yaml_parser_t, length: size
|
|||
(*parser).buffer.pointer as *const libc::c_void,
|
||||
size,
|
||||
);
|
||||
let fresh10 = &mut (*parser).buffer.pointer;
|
||||
let fresh10 = addr_of_mut!((*parser).buffer.pointer);
|
||||
*fresh10 = (*parser).buffer.start;
|
||||
let fresh11 = &mut (*parser).buffer.last;
|
||||
let fresh11 = addr_of_mut!((*parser).buffer.last);
|
||||
*fresh11 = ((*parser).buffer.start).c_offset(size as isize);
|
||||
} else if (*parser).buffer.pointer == (*parser).buffer.last {
|
||||
let fresh12 = &mut (*parser).buffer.pointer;
|
||||
let fresh12 = addr_of_mut!((*parser).buffer.pointer);
|
||||
*fresh12 = (*parser).buffer.start;
|
||||
let fresh13 = &mut (*parser).buffer.last;
|
||||
let fresh13 = addr_of_mut!((*parser).buffer.last);
|
||||
*fresh13 = (*parser).buffer.start;
|
||||
}
|
||||
while (*parser).unread < length {
|
||||
|
@ -387,83 +388,83 @@ pub unsafe fn yaml_parser_update_buffer(parser: *mut yaml_parser_t, length: size
|
|||
value as libc::c_int,
|
||||
);
|
||||
}
|
||||
let fresh14 = &mut (*parser).raw_buffer.pointer;
|
||||
let fresh14 = addr_of_mut!((*parser).raw_buffer.pointer);
|
||||
*fresh14 = (*fresh14).c_offset(width as isize);
|
||||
let fresh15 = &mut (*parser).offset;
|
||||
let fresh15 = addr_of_mut!((*parser).offset);
|
||||
*fresh15 = (*fresh15 as libc::c_ulong).wrapping_add(width as libc::c_ulong) as size_t
|
||||
as size_t;
|
||||
if value <= 0x7f as libc::c_int as libc::c_uint {
|
||||
let fresh16 = &mut (*parser).buffer.last;
|
||||
let fresh16 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh17 = *fresh16;
|
||||
*fresh16 = (*fresh16).c_offset(1);
|
||||
*fresh17 = value as yaml_char_t;
|
||||
} else if value <= 0x7ff as libc::c_int as libc::c_uint {
|
||||
let fresh18 = &mut (*parser).buffer.last;
|
||||
let fresh18 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh19 = *fresh18;
|
||||
*fresh18 = (*fresh18).c_offset(1);
|
||||
*fresh19 = (0xc0 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value >> 6 as libc::c_int)
|
||||
as yaml_char_t;
|
||||
let fresh20 = &mut (*parser).buffer.last;
|
||||
let fresh20 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh21 = *fresh20;
|
||||
*fresh20 = (*fresh20).c_offset(1);
|
||||
*fresh21 = (0x80 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value & 0x3f as libc::c_int as libc::c_uint)
|
||||
as yaml_char_t;
|
||||
} else if value <= 0xffff as libc::c_int as libc::c_uint {
|
||||
let fresh22 = &mut (*parser).buffer.last;
|
||||
let fresh22 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh23 = *fresh22;
|
||||
*fresh22 = (*fresh22).c_offset(1);
|
||||
*fresh23 = (0xe0 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value >> 12 as libc::c_int)
|
||||
as yaml_char_t;
|
||||
let fresh24 = &mut (*parser).buffer.last;
|
||||
let fresh24 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh25 = *fresh24;
|
||||
*fresh24 = (*fresh24).c_offset(1);
|
||||
*fresh25 = (0x80 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value >> 6 as libc::c_int & 0x3f as libc::c_int as libc::c_uint)
|
||||
as yaml_char_t;
|
||||
let fresh26 = &mut (*parser).buffer.last;
|
||||
let fresh26 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh27 = *fresh26;
|
||||
*fresh26 = (*fresh26).c_offset(1);
|
||||
*fresh27 = (0x80 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value & 0x3f as libc::c_int as libc::c_uint)
|
||||
as yaml_char_t;
|
||||
} else {
|
||||
let fresh28 = &mut (*parser).buffer.last;
|
||||
let fresh28 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh29 = *fresh28;
|
||||
*fresh28 = (*fresh28).c_offset(1);
|
||||
*fresh29 = (0xf0 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value >> 18 as libc::c_int)
|
||||
as yaml_char_t;
|
||||
let fresh30 = &mut (*parser).buffer.last;
|
||||
let fresh30 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh31 = *fresh30;
|
||||
*fresh30 = (*fresh30).c_offset(1);
|
||||
*fresh31 = (0x80 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value >> 12 as libc::c_int & 0x3f as libc::c_int as libc::c_uint)
|
||||
as yaml_char_t;
|
||||
let fresh32 = &mut (*parser).buffer.last;
|
||||
let fresh32 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh33 = *fresh32;
|
||||
*fresh32 = (*fresh32).c_offset(1);
|
||||
*fresh33 = (0x80 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value >> 6 as libc::c_int & 0x3f as libc::c_int as libc::c_uint)
|
||||
as yaml_char_t;
|
||||
let fresh34 = &mut (*parser).buffer.last;
|
||||
let fresh34 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh35 = *fresh34;
|
||||
*fresh34 = (*fresh34).c_offset(1);
|
||||
*fresh35 = (0x80 as libc::c_int as libc::c_uint)
|
||||
.wrapping_add(value & 0x3f as libc::c_int as libc::c_uint)
|
||||
as yaml_char_t;
|
||||
}
|
||||
let fresh36 = &mut (*parser).unread;
|
||||
let fresh36 = addr_of_mut!((*parser).unread);
|
||||
*fresh36 = (*fresh36).wrapping_add(1);
|
||||
}
|
||||
if (*parser).eof != 0 {
|
||||
let fresh37 = &mut (*parser).buffer.last;
|
||||
let fresh37 = addr_of_mut!((*parser).buffer.last);
|
||||
let fresh38 = *fresh37;
|
||||
*fresh37 = (*fresh37).c_offset(1);
|
||||
*fresh38 = '\0' as i32 as yaml_char_t;
|
||||
let fresh39 = &mut (*parser).unread;
|
||||
let fresh39 = addr_of_mut!((*parser).unread);
|
||||
*fresh39 = (*fresh39).wrapping_add(1);
|
||||
return 1 as libc::c_int;
|
||||
}
|
||||
|
|
1410
src/scanner.rs
1410
src/scanner.rs
File diff suppressed because it is too large
Load diff
|
@ -2,12 +2,13 @@ use crate::{
|
|||
libc, size_t, yaml_emitter_t, PointerExt, YAML_UTF16LE_ENCODING, YAML_UTF8_ENCODING,
|
||||
YAML_WRITER_ERROR,
|
||||
};
|
||||
use std::ptr::addr_of_mut;
|
||||
unsafe fn yaml_emitter_set_writer_error(
|
||||
mut emitter: *mut yaml_emitter_t,
|
||||
problem: *const libc::c_char,
|
||||
) -> libc::c_int {
|
||||
(*emitter).error = YAML_WRITER_ERROR;
|
||||
let fresh0 = &mut (*emitter).problem;
|
||||
let fresh0 = addr_of_mut!((*emitter).problem);
|
||||
*fresh0 = problem;
|
||||
0 as libc::c_int
|
||||
}
|
||||
|
@ -15,9 +16,9 @@ pub unsafe fn yaml_emitter_flush(emitter: *mut yaml_emitter_t) -> libc::c_int {
|
|||
__assert!(!emitter.is_null());
|
||||
__assert!(((*emitter).write_handler).is_some());
|
||||
__assert!((*emitter).encoding as u64 != 0);
|
||||
let fresh1 = &mut (*emitter).buffer.last;
|
||||
let fresh1 = addr_of_mut!((*emitter).buffer.last);
|
||||
*fresh1 = (*emitter).buffer.pointer;
|
||||
let fresh2 = &mut (*emitter).buffer.pointer;
|
||||
let fresh2 = addr_of_mut!((*emitter).buffer.pointer);
|
||||
*fresh2 = (*emitter).buffer.start;
|
||||
if (*emitter).buffer.start == (*emitter).buffer.last {
|
||||
return 1 as libc::c_int;
|
||||
|
@ -30,9 +31,9 @@ pub unsafe fn yaml_emitter_flush(emitter: *mut yaml_emitter_t) -> libc::c_int {
|
|||
as size_t,
|
||||
) != 0
|
||||
{
|
||||
let fresh3 = &mut (*emitter).buffer.last;
|
||||
let fresh3 = addr_of_mut!((*emitter).buffer.last);
|
||||
*fresh3 = (*emitter).buffer.start;
|
||||
let fresh4 = &mut (*emitter).buffer.pointer;
|
||||
let fresh4 = addr_of_mut!((*emitter).buffer.pointer);
|
||||
*fresh4 = (*emitter).buffer.start;
|
||||
return 1 as libc::c_int;
|
||||
} else {
|
||||
|
@ -91,14 +92,14 @@ pub unsafe fn yaml_emitter_flush(emitter: *mut yaml_emitter_t) -> libc::c_int {
|
|||
.wrapping_add((octet as libc::c_int & 0x3f as libc::c_int) as libc::c_uint);
|
||||
k = k.wrapping_add(1);
|
||||
}
|
||||
let fresh5 = &mut (*emitter).buffer.pointer;
|
||||
let fresh5 = addr_of_mut!((*emitter).buffer.pointer);
|
||||
*fresh5 = (*fresh5).c_offset(width as isize);
|
||||
if value < 0x10000 as libc::c_int as libc::c_uint {
|
||||
*((*emitter).raw_buffer.last).c_offset(high as isize) =
|
||||
(value >> 8 as libc::c_int) as libc::c_uchar;
|
||||
*((*emitter).raw_buffer.last).c_offset(low as isize) =
|
||||
(value & 0xff as libc::c_int as libc::c_uint) as libc::c_uchar;
|
||||
let fresh6 = &mut (*emitter).raw_buffer.last;
|
||||
let fresh6 = addr_of_mut!((*emitter).raw_buffer.last);
|
||||
*fresh6 = (*fresh6).c_offset(2 as libc::c_int as isize);
|
||||
} else {
|
||||
value = value.wrapping_sub(0x10000 as libc::c_int as libc::c_uint);
|
||||
|
@ -113,7 +114,7 @@ pub unsafe fn yaml_emitter_flush(emitter: *mut yaml_emitter_t) -> libc::c_int {
|
|||
as libc::c_uchar;
|
||||
*((*emitter).raw_buffer.last).c_offset((low + 2 as libc::c_int) as isize) =
|
||||
(value & 0xff as libc::c_int as libc::c_uint) as libc::c_uchar;
|
||||
let fresh7 = &mut (*emitter).raw_buffer.last;
|
||||
let fresh7 = addr_of_mut!((*emitter).raw_buffer.last);
|
||||
*fresh7 = (*fresh7).c_offset(4 as libc::c_int as isize);
|
||||
}
|
||||
}
|
||||
|
@ -124,13 +125,13 @@ pub unsafe fn yaml_emitter_flush(emitter: *mut yaml_emitter_t) -> libc::c_int {
|
|||
as size_t,
|
||||
) != 0
|
||||
{
|
||||
let fresh8 = &mut (*emitter).buffer.last;
|
||||
let fresh8 = addr_of_mut!((*emitter).buffer.last);
|
||||
*fresh8 = (*emitter).buffer.start;
|
||||
let fresh9 = &mut (*emitter).buffer.pointer;
|
||||
let fresh9 = addr_of_mut!((*emitter).buffer.pointer);
|
||||
*fresh9 = (*emitter).buffer.start;
|
||||
let fresh10 = &mut (*emitter).raw_buffer.last;
|
||||
let fresh10 = addr_of_mut!((*emitter).raw_buffer.last);
|
||||
*fresh10 = (*emitter).raw_buffer.start;
|
||||
let fresh11 = &mut (*emitter).raw_buffer.pointer;
|
||||
let fresh11 = addr_of_mut!((*emitter).raw_buffer.pointer);
|
||||
*fresh11 = (*emitter).raw_buffer.start;
|
||||
1 as libc::c_int
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue