Swatantra-66 opened a new pull request, #21118:
URL: https://github.com/apache/nuttx/pull/21118

   ## Summary
   In commit 
[`a0b0852025`](https://github.com/apache/nuttx/commit/a0b08520252a2b1d439118a90abe6b51a0440c61),
 `NBBY` (`#define NBBY CHAR_BIT`) was added to `<sys/param.h>` for bit-array 
sizing.
   
   Traditional BSDs (FreeBSD, OpenBSD, NetBSD), glibc, and musl define standard 
bit-string manipulation macros in `<sys/param.h>` that operate on byte arrays 
using `NBBY`:
   - `setbit(a, i)`: Sets bit `i` in byte array `a`.
   - `clrbit(a, i)`: Clears bit `i` in byte array `a`.
   - `isset(a, i)`: Tests if bit `i` in byte array `a` is set (evaluates to 
non-zero if set, 0 otherwise).
   - `isclr(a, i)`: Tests if bit `i` in byte array `a` is cleared (evaluates to 
non-zero if clear, 0 otherwise).
   
   This patch implements these standard convenience macros in 
`include/sys/param.h` (guarded with `#ifndef`), improving BSD/POSIX portability.
   
   ## Impact
   - **Users/Developers:** Adds standard BSD bit-string convenience macros in 
`<sys/param.h>`.
   - **Compatibility:** Backward compatible. No existing APIs, ABI, or 
behaviors modified (all macros guarded by `#ifndef`).
   - **Build/Hardware:** Zero impact on existing builds.
   
   ## Testing
   - Verified syntax, header definition availability (`NBBY`), and clean 
compilation.
   - Verified style adherence via `tools/checkpatch.sh`:
     - 0 errors, 0 warnings.
     - All lines within standard 78-column limit (longest is 69 columns).
     - No trailing whitespace.
   - Verified macro behavior across bit boundaries (byte offsets $0..3$, bit 
positions $0..31$, clear vs set state transitions).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to