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

sockets(examples): remove unused register keyword, replace bzero with memset #410

Closed
wants to merge 1 commit into from

Conversation

rilysh
Copy link
Contributor

@rilysh rilysh commented Sep 4, 2024

* Remove the redundant register keyword from the variables, as most compilers (GCC/Clang) just ignore them, and they're mostly just noise.

* Replace bzero() with memset(). IEEE 1003.1-2008 removes the spec of bzero(), replacing it with memset().

* Use socklen_t (unsigned type) for variable b in the socket bind example.

* Add unistd.h header file in the socket connect example (it is used by the write() and read() libc calls). Remove unnecessary (char *) cast from argv[1].

… memset

* Remove the redundant register keyword from the variables, as most
compilers (GCC/Clang) just ignore them, and they're mostly just noise.

* Replace bzero() with memset(). IEEE 1003.1-2008 removes the spec of
bzero(), replacing it with memset().

* Use socklen_t (unsigned type) for variable b in the socket bind example.

* Add unistd.h header file in the socket connect example (it is used by
the write() and read() libc calls). Remove unnecessary (char *) cast
from argv[1].

Signed-off-by: rilysh <[email protected]>
@debdrup
Copy link
Member

debdrup commented Sep 4, 2024

I've adjusted the commit message slightly to fit within the columniation that FreeBSD uses, and I've sought review from emaste just to double-check things, so I'm gonna commit this.

Thanks :)

@debdrup
Copy link
Member

debdrup commented Sep 4, 2024

Since I forgot to mention the PR in the commit, I'll just add that it's committed as 920aa82eb14.

Thanks again.

@debdrup debdrup closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants