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

clean up interface of substdio functions #271

Merged
merged 4 commits into from
Apr 5, 2024
Merged

Conversation

DerDakon
Copy link
Member

Get rid of declaration without arguments in the header, as that causes warnings in most recent compilers. While at it clean up a bit more.

I'm not aware of any patch that modifies substdio.h or any of it's functions, so I think this is safe.

@DerDakon DerDakon added this to the 1.09 milestone Mar 23, 2024
Copy link

@josuah josuah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops! Yes, much needed changes...
The inline are also a good thing to have, in particular when strlen() is involved.

These functions are usually called with a character literal as second argument.
When these functions are static inlines this allows the compiler to entirely
avoid the runtime call to strlen() and pass a constant there. These functions
are not turned into defines as that may evaluate the "buf" argument twice which
would suddenly emit incorrect code if someone passes things like "buf++".
…flush()

This was now the only function without a complete interface in the header.
@DerDakon DerDakon merged commit c260cb5 into master Apr 5, 2024
50 checks passed
@DerDakon DerDakon deleted the Dakon/substdio-kr branch April 5, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants