Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is TINFL_FLAG_HAS_MORE_INPUT necessary? #86

Open
Plecra opened this issue Jul 9, 2020 · 1 comment
Open

Is TINFL_FLAG_HAS_MORE_INPUT necessary? #86

Plecra opened this issue Jul 9, 2020 · 1 comment
Labels

Comments

@Plecra
Copy link
Contributor

Plecra commented Jul 9, 2020

#[inline]
fn end_of_input(flags: u32) -> Action {
Action::End(if flags & TINFL_FLAG_HAS_MORE_INPUT != 0 {
TINFLStatus::NeedsMoreInput
} else {
TINFLStatus::FailedCannotMakeProgress
})
}

It seems like the flag only serves to rename the NeedsMoreInput variant to FailedCannotMakeProgress at runtime. Both of the errors only seem to be created in this function. The API doesn't seem to do much but confuse users, so could it be removed? (NeedsMoreInput is a perfectly reasonable error state if the caller already knows there's no more input)

@oyvindln
Copy link
Collaborator

oyvindln commented Aug 5, 2020

Not sure, will have to look into it, some of these flags are remnants from porting miniz from C.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants