• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blues / note-c / 22673089293
93%

Build:
DEFAULT BRANCH: master
Ran 04 Mar 2026 02:18PM UTC
Jobs 1
Files 9
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Mar 2026 02:11PM UTC coverage: 93.364% (+0.005%) from 93.359%
22673089293

push

github

web-flow
refactor: propagate const through internal transmit chain (phase 1 of 2) (#228)

* refactor: propagate const through internal transmit chain

Make internal transmit functions accept const uint8_t * buffers,
reflecting that the transmit path never modifies its input data.

This resolves scattered const-discarding casts at call sites (e.g.
(uint8_t *)c_newline, (uint8_t *)request) by giving them a
const-correct destination type. The internal nTransmitFn typedef
is updated to match.

At the two public API boundaries (_noteSerialTransmit and
_noteI2CTransmit), an intentional cast back to uint8_t * is added
with an explanatory comment, consolidating the remaining const
inconsistency to a single known location per interface. These casts
will be removed in a follow-up breaking change when serialTransmitFn
and i2cTransmitFn are updated to accept const uint8_t *.

No functional or behavioral change — purely a const-correctness
cleanup. The public hook typedefs (serialTransmitFn, i2cTransmitFn)
are intentionally left unchanged for this commit.

* fix: use stack buffers for flash-resident literals in transmit calls

Replace direct casts of flash-resident string literals with small
stack-allocated buffers at the three call sites where .rodata data
was passed through the non-const transmit hook boundary:

- n_serial.c: c_newline (\r\n) appended after JSON body
- n_serial.c: "\n" sent during serial reset/resync
- n_i2c.c:    "\n" sent during I2C reset/resync

Each buffer is 1-2 bytes. The stack cost is negligible, but the
consequence is meaningful: the hook receives a pointer to mutable
RAM rather than flash, eliminating the UB that would occur if any
hook implementation writes to the buffer before transmitting.

The intentional boundary casts in _noteSerialTransmit and
_noteI2CTransmit remain in place, but with these stack buffers the
pointed-to memory is now genuinely mutable, so no UB can arise even
if a hook writes to it.

TODO comments on each buffer mark them... (continued)

1192 of 1367 branches covered (87.2%)

Branch coverage included in aggregate %.

17 of 17 new or added lines in 3 files covered. (100.0%)

2452 of 2536 relevant lines covered (96.69%)

79.43 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22673089293.1 04 Mar 2026 02:18PM UTC 9
93.36
GitHub Action Run
Source Files on build 22673089293
  • Tree
  • List 9
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 64798078 on github
  • Prev Build on master (#22369434818)
  • Next Build on master (#22673132835)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc