Skip to content

fix(cpp23): shadow identifier + C-style cast cleanup in Wave files (ADR-0839) - #196

Closed
lusoris wants to merge 1 commit into
masterfrom
fix/cpp23-shadow-const-fixes
Closed

lusoris wants to merge 1 commit into
masterfrom
fix/cpp23-shadow-const-fixes

Conversation

@lusoris

@lusoris lusoris commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Mechanical correctness fixes in three post-C++23-wave .cpp files that carried
residual C-style casts and a shadowed identifier from their C originals:

  • core/src/fex_ctx_vector.cpp: rename local capacity → new_capacity to
    eliminate the -Wshadow / bugprone-shadow hit against rfe->capacity.
  • core/src/feature/feature_collector.cpp: replace every C-style cast
    ((char*), (void*), (FeatureVector**), (VmafFeatureCollector*),
    (VmafPredictModel*), (decltype(...)), (VmafModelFlags)0) with
    static_cast<>. No logic change.
  • core/src/sycl/common.cpp: replace (uint8_t*), (size_t), and (unsigned)
    C-style casts with static_cast<> in the frame-upload and plane-copy paths.

ADR: docs/adr/0839-cpp23-shadow-const-fixes.md

Six deliverables checklist (ADR-0108)

  • Research digest — no digest needed: trivial mechanical cast replacements
  • Decision matrix in ADR-0839 ## Alternatives considered
  • AGENTS.md invariant note — no rebase-sensitive invariants: all changed files are fork-local C++23 conversions with no upstream counterpart
  • Reproducer / smoke-test: meson test -C build --suite=fast (no behaviour change; existing tests cover the changed functions)
  • changelog.d/fixed/cpp23-shadow-const-fixes.md
  • docs/rebase-notes.md — no rebase impact: all changed files are fork-local

State.md

No bugs opened or closed; no state.md update needed.

ffmpeg-patches

No public C-API or header changes; no patch update needed.

Test plan

  • meson test -C build --suite=fast passes
  • make lint (clang-tidy) reports no new cppcoreguidelines-pro-type-cstyle-cast or bugprone-shadow hits on the three changed files

🤖 Generated with Claude Code

@lusoris
lusoris enabled auto-merge (squash) May 29, 2026 11:27
@lusoris
lusoris disabled auto-merge May 29, 2026 11:42
@lusoris
lusoris marked this pull request as draft May 29, 2026 11:42
…DR-0839)

Three post-C++23-wave files had residual issues that are warnings in C++
but were silently accepted in the C originals:

- core/src/fex_ctx_vector.cpp: rename local `capacity` → `new_capacity`
  to eliminate the -Wshadow hit against the `rfe->capacity` struct member.

- core/src/feature/feature_collector.cpp: replace all C-style casts
  — `(char*)`, `(void*)`, `(FeatureVector**)`, `(VmafFeatureCollector*)`,
  `(VmafPredictModel*)`, `(decltype(...))`, `(VmafModelFlags)0` —
  with `static_cast<>`. No behaviour change.

- core/src/sycl/common.cpp: replace `(uint8_t*)`, `(size_t)`, and
  `(unsigned)` C-style casts with `static_cast<>` in the
  frame-upload and plane-copy paths.

No logic changes. Fixes cppcoreguidelines-pro-type-cstyle-cast and
bugprone-shadow clang-tidy hits. All three files are fork-local (no
upstream counterpart in Netflix/vmaf master).

ADR: docs/adr/0839-cpp23-shadow-const-fixes.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lusoris
lusoris force-pushed the fix/cpp23-shadow-const-fixes branch from 493918b to 43d65e8 Compare May 29, 2026 12:13
@lusoris

lusoris commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

Cascading rebase conflicts. Recreated clean as 6 files in next PR.

@lusoris lusoris closed this May 30, 2026
lusoris added a commit that referenced this pull request May 30, 2026
…DR-0839) (#258)

Mechanical cleanup in 3 post-C++23-wave cpp files:
- fex_ctx_vector.cpp: rename local 'capacity' → 'new_capacity' (shadow fix)
- feature_collector.cpp: every (T*) C-style cast → static_cast<T*>
- sycl/common.cpp: same C-style → static_cast<> pattern

Recreates closed PR #196's 6-file targeted change from current master
(the original had cascading rebase conflicts from #197+#212+#256 etc).
docs/adr/README.md index row already present on master; skipping that file.

Co-authored-by: lusoris <lusoris@pm.me>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@lusoris
lusoris deleted the fix/cpp23-shadow-const-fixes branch June 4, 2026 08:11
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.

1 participant