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

[BUG] lib_outstream_s putc and puts are redundant #14738

Open
1 task done
yamt opened this issue Nov 12, 2024 · 1 comment
Open
1 task done

[BUG] lib_outstream_s putc and puts are redundant #14738

yamt opened this issue Nov 12, 2024 · 1 comment
Labels
Arch: all Issues that apply to all architectures Area: Api API Issues OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working

Comments

@yamt
Copy link
Contributor

yamt commented Nov 12, 2024

Description / Steps to reproduce the issue

lib_outstream_s has two seemingly-redundant methods, one for single-char operation and another for multi-chars operation, for no obvious reasons. (well, at least not obvious to me.)
if it's necessary for some reasons, it should have been commented in the code.
otherwise, one of them, maybe the single-char version which is likely slower, should be removed to save code size.

ditto for

  • lib_instream_s getc and gets
  • syslog_putc and syslog_write
  • syslog sc_putc/sc_force and sc_write/sc_write_force
  • up_putc and up_nputs

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

macOS 14.7

NuttX Version

master

Issue Architecture

[Arch: all]

Issue Area

[Area: Api]

Verification

  • I have verified before submitting the report.
@yamt yamt added the Type: Bug Something isn't working label Nov 12, 2024
@github-actions github-actions bot added Arch: all Issues that apply to all architectures Area: Api API Issues OS: Mac Issues related to MacOS (building system, etc) labels Nov 12, 2024
@xiaoxiang781216
Copy link
Contributor

puts is added later to improve the performance, it's better to drop putc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: all Issues that apply to all architectures Area: Api API Issues OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants