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

refactor(wpabuf): simplify byte swaps #259

Merged
merged 5 commits into from
Sep 6, 2022
Merged

Conversation

aloisklink
Copy link
Contributor

Cleans up the wpabuf.h file to improve support for non Linux OSes like FreeBSD.

As of glibc 2.19, the following macros are defined in endian.h:

htobe16(), htole16(), be16toh(), le16toh(), htobe32(), htole32(),
be32toh(), le32toh(), htobe64(), htole64(), be64toh(), le64toh()

These macros are also defined in FreeBSD, however they are located in the <sys/endian.h> file.

As of glibc 2.19, the following macros are defined in `endian.h`:
  htobe16(), htole16(), be16toh(), le16toh(), htobe32(), htole32(),
  be32toh(), le32toh(), htobe64(), htole64(), be64toh(), le64toh()

These macros are also defined in FreeBSD, where they are located
in the `<sys/endian.h>` file.
These defines are not used anywhere, and are non-standard, and
don't appear on FreeBSD.
(variables starting with `__` should generally not be used).
Sparse is only used for checking the Linux kernel, we do not use
it in this project.
@aloisklink aloisklink added the refactor Refactoring code label Sep 5, 2022
@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Merging #259 (0aaf983) into main (9723124) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #259   +/-   ##
=======================================
  Coverage   48.51%   48.51%           
=======================================
  Files         113      113           
  Lines       17887    17887           
=======================================
  Hits         8678     8678           
  Misses       9209     9209           
Impacted Files Coverage Δ
src/radius/wpabuf.h 80.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

src/radius/wpabuf.h Show resolved Hide resolved
@aloisklink aloisklink merged commit 58a9bf8 into main Sep 6, 2022
@aloisklink aloisklink deleted the refactor/simplify-byte-swaps branch September 6, 2022 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants