Eliminate return value of queue init

This commit is contained in:
David Tolnay 2022-07-30 01:20:14 -07:00
parent 5c028a3ded
commit da96d42456
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
2 changed files with 11 additions and 14 deletions

View file

@ -184,14 +184,13 @@ pub unsafe fn yaml_parser_initialize(parser: *mut yaml_parser_t) -> Success {
);
BUFFER_INIT!(parser, (*parser).raw_buffer, INPUT_RAW_BUFFER_SIZE);
BUFFER_INIT!(parser, (*parser).buffer, INPUT_BUFFER_SIZE);
if QUEUE_INIT!(parser, (*parser).tokens, yaml_token_t).ok {
STACK_INIT!(parser, (*parser).indents, libc::c_int);
STACK_INIT!(parser, (*parser).simple_keys, yaml_simple_key_t);
STACK_INIT!(parser, (*parser).states, yaml_parser_state_t);
STACK_INIT!(parser, (*parser).marks, yaml_mark_t);
STACK_INIT!(parser, (*parser).tag_directives, yaml_tag_directive_t);
return OK;
}
QUEUE_INIT!(parser, (*parser).tokens, yaml_token_t);
STACK_INIT!(parser, (*parser).indents, libc::c_int);
STACK_INIT!(parser, (*parser).simple_keys, yaml_simple_key_t);
STACK_INIT!(parser, (*parser).states, yaml_parser_state_t);
STACK_INIT!(parser, (*parser).marks, yaml_mark_t);
STACK_INIT!(parser, (*parser).tag_directives, yaml_tag_directive_t);
return OK;
BUFFER_DEL!((*parser).raw_buffer);
BUFFER_DEL!((*parser).buffer);
QUEUE_DEL!((*parser).tokens);
@ -327,11 +326,10 @@ pub unsafe fn yaml_emitter_initialize(mut emitter: *mut yaml_emitter_t) -> Succe
BUFFER_INIT!(emitter, (*emitter).buffer, OUTPUT_BUFFER_SIZE);
BUFFER_INIT!(emitter, (*emitter).raw_buffer, OUTPUT_RAW_BUFFER_SIZE);
STACK_INIT!(emitter, (*emitter).states, yaml_emitter_state_t);
if QUEUE_INIT!(emitter, (*emitter).events, yaml_event_t).ok {
STACK_INIT!(emitter, (*emitter).indents, libc::c_int);
STACK_INIT!(emitter, (*emitter).tag_directives, yaml_tag_directive_t);
return OK;
}
QUEUE_INIT!(emitter, (*emitter).events, yaml_event_t);
STACK_INIT!(emitter, (*emitter).indents, libc::c_int);
STACK_INIT!(emitter, (*emitter).tag_directives, yaml_tag_directive_t);
return OK;
BUFFER_DEL!((*emitter).buffer);
BUFFER_DEL!((*emitter).raw_buffer);
STACK_DEL!((*emitter).states);

View file

@ -433,7 +433,6 @@ macro_rules! QUEUE_INIT {
$queue.tail = $queue.start;
$queue.head = $queue.tail;
$queue.end = $queue.start.offset(16_isize);
OK
}};
}