Skip to content

Fix -Wshadow warnings in library sources (#169) - #6

Closed
zakoverflow wants to merge 1 commit into
masterfrom
xerj-ab2/with-xerj
Closed

zakoverflow wants to merge 1 commit into
masterfrom
xerj-ab2/with-xerj

Conversation

@zakoverflow

Copy link
Copy Markdown
Owner

Shadowing part of blues#169 only.

  • n_helpers.c: 6 inner const char *err redeclarations become assignments to the outer err (each returns right away); inner J *req for card.binary.put renamed putReq.
  • n_i2c.c: 1 inner err redeclaration becomes an assignment.
  • CMakeLists.txt: add -Wshadow to the note_c unit-test target (already -Werror) as a regression guard.

gcc -fsyntax-only -Wshadow -I. n_*.c: 8 warnings (16 diagnostic lines incl. notes) -> 0. Unit tests: 166/166 pass.

Blast radius: local variable names only, in NoteBinaryStoreReceive/Transmit and _i2cNoteQueryLength; no API, ABI, or control-flow change. Build flag affects the test target only.

Reuse the outer err variable instead of redeclaring it in inner scopes
(each path returns immediately), rename the inner card.binary.put request
to putReq, and add -Wshadow to the unit-test library build so new
shadowing fails under -Werror. No behavior change.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 38460736362

Coverage remained the same at 93.408%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 1 uncovered change across 1 file (13 of 14 lines covered, 92.86%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
n_helpers.c 13 12 92.31%
Total (2 files) 14 13 92.86%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2611
Covered Lines: 2526
Line Coverage: 96.74%
Relevant Branches: 1409
Covered Branches: 1229
Branch Coverage: 87.22%
Branches in Coverage %: Yes
Coverage Strength: 80.3 hits per line

💛 - Coveralls

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