Skip to content

Remove dead code: #if 0 blocks and commented-out statements - #498

Merged
xroche merged 2 commits into
masterfrom
remove-dead-code
Jul 6, 2026
Merged

Remove dead code: #if 0 blocks and commented-out statements#498
xroche merged 2 commits into
masterfrom
remove-dead-code

Conversation

@xroche

@xroche xroche commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Removes all 33 #if 0 blocks and roughly 650 lines of commented-out statements, declarations and calls. Blocks with a live #else keep that branch, and the htsweb.c DEBUG toggle stays since its #else arm is the active definition. Dead satellites go with the blocks: the sig_ask interactive signal handlers, check_rate, HTS_TOTAL_RECV_CHECK, the no-op make_empty_index, and the prototypes and commented declarations that only served them.

Comments that document live code stay (usage examples, config-knob docs like HTS_TRACE_MALLOC), and the 3.43 warning against post-excluding authorized links is now a plain comment. No behavior change: make check passes, and the insertions in the diff are clang-format rewraps of live lines the deletions touched.

xroche and others added 2 commits July 6, 2026 10:16
All #if 0 code that has been disabled for years goes away: the sig_ask
interactive signal handlers, check_rate, HTS_TOTAL_RECV_CHECK, the
make_empty_index no-op body (function removed with its only call site),
the htscharset sample main(), the dead FTP CWD sequence, and assorted
disabled fragments in the parser and engine. Blocks with a live #else
keep that branch. The htsweb.c DEBUG toggle stays: its #else arm is the
live definition and the macro is used.

The htsparse.c 3.43 note about not post-excluding authorized links is
kept as a plain comment; commented-out declarations and calls that only
served the removed blocks go with them. French comments rewrapped by
the formatter were translated in passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
Sweep of ~650 lines of //-disabled statements, declarations, and calls
(plus three /*-wrapped dead blocks in htscoremain.c and htscore.c and
the MFC pApp remnant in htsserver.c). Prose comments stay, including
labels that describe live code; usage examples and config-knob docs
(HTS_TRACE_MALLOC, the htsweb.c DEBUG toggle) were kept. Insertions are
clang-format rewraps of live lines that became touched by the deletions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche merged commit 5f7045c into master Jul 6, 2026
15 checks passed
@xroche
xroche deleted the remove-dead-code branch July 27, 2026 18:26
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