RRichard Russonbugprone: add default cases for switch-missing-default-case
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
neomutt: init_config() Initialise the config from neomutt_init(). | 8 个月前 | |
bugprone: add default cases for switch-missing-default-case Fixes the second of the three categories flatcap flagged as good candidates on #4970 (55 sites across 33 files, matching his count exactly). Each switch was read in full to determine the semantically correct default, not just silenced mechanically: - Most are op/command dispatchers or menu-choice switches (event->op, mw_multi_choice() results, single-letter responses) where the existing code already has an implicit fallback after the switch (a later return, or falling through to shared code) -- these get `default: break;` to make that explicit without changing behaviour. - A few (external.c, muttlib.c, send/send.c) explicitly mirror the existing "abort" case's behaviour, since leaving the loop/function state unchanged on an impossible value would otherwise risk an infinite loop or a silently-wrong return. - pattern/exec.c's two large op-table dispatchers already had an explicit "unknown op" error path after the switch; the new default falls through to it, matching the existing intent exactly. - A handful (pop/auth.c, pop/lib.c, pop/pop.c) switch on documented function return codes; checked each callee's own @retval doc comment to confirm every case was genuinely covered, and matched the default to whichever existing case already represents "no specific outcome" for that function. No case does more than reproduce behaviour the code already had implicitly -- this is a defensiveness/documentation change, not a behaviour change. Verification: `clang-tidy -p . <file> --checks='-*,bugprone-switch-missing-default-case'` now reports 0 warnings across all 55 sites (was 55). Full clean build, `make test` passes (all suites), `clang-format --dry-run -Werror` clean on every changed file (one pre-existing, unrelated violation in autocrypt/gpgme.c confirmed via `git stash` before and after -- not introduced by this change). AI assistance: mechanical location of all 55 sites and the semantic analysis of each switch (tracing callee return contracts, existing fallback behaviour, and loop-safety implications) was done by Claude Code; I reviewed the reasoning and diff before this went up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> | 1 个月前 | |
refactor: upgrade macro flags to enum flags Turn #define'd flags into enums. Enums provide: - debugger visibility - compiler diagnostics - symbol scoping by convention - easier navigation/search - cleaner documentation generation - type grouping Naming: - enum has singular ending, e.g. Flag - typedef wrapper has plural ending, e.g. Flags Suffix `_NO_FLAGS` has been renamed to `_NONE` for consistency. | 4 个月前 | |
add more data to function dispatchers | 5 个月前 | |
refactor: upgrade macro flags to enum flags Turn #define'd flags into enums. Enums provide: - debugger visibility - compiler diagnostics - symbol scoping by convention - easier navigation/search - cleaner documentation generation - type grouping Naming: - enum has singular ending, e.g. Flag - typedef wrapper has plural ending, e.g. Flags Suffix `_NO_FLAGS` has been renamed to `_NONE` for consistency. | 4 个月前 | |
iwyu: fix includes | 3 个月前 | |
module: tidy cleanup Pass the Module Data to the Module on cleanup() | 5 个月前 | |
module: add Notify object to each globals Add a 'struct Notify *notify' member to every ModuleData struct. Create it with notify_new() in each Module.init() function, set its parent to NeoMutt->notify, and free it in Module.cleanup(). For modules that previously had commented-out init/cleanup code, uncomment the mod_data allocation and deallocation. | 5 个月前 | |
refactor: upgrade macro flags to enum flags Turn #define'd flags into enums. Enums provide: - debugger visibility - compiler diagnostics - symbol scoping by convention - easier navigation/search - cleaner documentation generation - type grouping Naming: - enum has singular ending, e.g. Flag - typedef wrapper has plural ending, e.g. Flags Suffix `_NO_FLAGS` has been renamed to `_NONE` for consistency. | 4 个月前 | |
msgwin: control own visibility for messages when hidden If another Window is pushed on top of the Message Window in the Message Container (e.g. for user input), the Message Window is hidden and any messages displayed in that state would not be seen. Update the Message Window so that: - when hidden, messages cause it to make itself visible and trigger a reflow - mutt_clear_error() clears the text and, if the Message Window isn't the only Window in the stack, hides itself again and reflows. | 4 个月前 | |
refactor: upgrade struct Menu to use MenuDefinition pointer Replace 'enum MenuType type' with 'const struct MenuDefinition *md' in struct Menu. Update menu_new() to take a MenuDefinition pointer directly instead of a MenuType enum. All callers updated to use menu->md->id where the type ID is needed, and menu->md directly where the MenuDefinition was previously looked up via menu_find(). Also fix pre-existing issues: typo in help.c and missing include in compose/attach.c. Co-authored-by: Amp <amp@ampcode.com> | 6 个月前 | |
menu: add repeat-count support to tag function - Update menu_tagging_dispatcher() to pass event->count to op_tag() - Update menu/op_tag() to tag N consecutive entries instead of 1 - Update index/op_tag() to tag N consecutive emails instead of 1 - Tag function now supports repeat-count: 5t tags 5 items - Works across all menus that support tagging: - alias, query, attach, autocrypt, browser, compose, history, - gpgme, pgp, smime, pattern, postpone - Update resolve_email() to accept count parameter (default 1) | 4 个月前 | |
tidy code - tidy include guards - drop unused menu refs | 1 个月前 | |
menu: fix repaint A stray deletion caused menu repainting to fail. | 2 个月前 |