RRichard Russonbugprone: add default cases for switch-missing-default-case
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 3 个月前 | |
replace AliasList with AliasArray - Remove TAILQ_ENTRY from struct Alias - Define AliasArray using ARRAY_HEAD(AliasArray, struct Alias *) - Update global Aliases variable to use AliasArray - Replace all TAILQ operations with ARRAY operations: - TAILQ_FOREACH → ARRAY_FOREACH - TAILQ_INSERT_TAIL → ARRAY_ADD - TAILQ_REMOVE → ARRAY_REMOVE - TAILQ_HEAD_INITIALIZER → ARRAY_HEAD_INITIALIZER - TAILQ_EMPTY → ARRAY_EMPTY - Update aliaslist_clear() to work with AliasArray - Update function signatures in functions.h and gui.h - Update all usage in alias.c, commands.c, dlg_alias.c, dlg_query.c, and functions.c Assisted-by: GitHub Copilot | 7 个月前 | |
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 个月前 | |
alias: encapsulate globals | 7 个月前 | |
Sort include <stddef.h> Semi-scripted change: $ find * -type f \ | grep '\.[ch]$' \ | xargs grep -l 'include.*stddef' \ | while read f; do clang-format -i "$f"; done; Plus manually removing unrelated changes. Fixes: ac6ef83f3229 ("fix: build of imap/auth_sasl.c") Closes: <https://github.com/neomutt/neomutt/issues/4284> Cc: Richard Russon <rich@flatcap.org> Signed-off-by: Alejandro Colomar <alx@kernel.org> | 2 年前 | |
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 个月前 | |
Fix function pointer types (#4337) This fixes the UB warning: `Call to function ... through pointer to incorrect function type`. | 2 年前 | |
neomutt: init_config() Initialise the config from neomutt_init(). | 8 个月前 | |
alias: discard pending deletions on exit Distinguish <exit> from <quit> in the Alias Dialog by clearing delayed deletion marks for OP_EXIT. OP_QUIT and address selection continue to commit pending alias deletions. | 1 个月前 | |
initialise things Ensure that pointers, structs and variables used as outparams are initialised. (some of variable types were obscured by typedefs) | 3 个月前 | |
expando: rename RenderData to RenderCallback The struct doesn't contain any data, just callback functions. | 1 年前 | |
iwyu: fix headers | 1 年前 | |
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 个月前 | |
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 个月前 | |
move group.[ch] from email/ to alias/ | 5 个月前 | |
Revert "merge: alias dialog: hide mail prompt" Upcoming commits will make the Message Window visible, instead. This reverts commit 00efc791c2435a90ebdd7ea8a0daf1d03f3f4cdc, reversing changes made to 385a043674979761a7590d5164d5e140cf9b08bd. | 4 个月前 | |
Revert "merge: alias dialog: hide mail prompt" Upcoming commits will make the Message Window visible, instead. This reverts commit 00efc791c2435a90ebdd7ea8a0daf1d03f3f4cdc, reversing changes made to 385a043674979761a7590d5164d5e140cf9b08bd. | 4 个月前 | |
keys: pass NeoMutt through init - pass struct NeoMutt from main into init_keys and the menu key init helpers - update each key init function to use the passed module owner instead of the global - adjust direct test callers to the new signatures | 5 个月前 | |
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 个月前 | |
module: pass data into helpers Update helper functions reached from module init/cleanup paths so callers pass the module-owned fields they use, or the module data pointer when several fields are needed. This removes extra neomutt_get_module_data() lookups from attach, autocrypt, color, conn, gui, history, hooks, key, menu, ncrypt, and sidebar helpers, and updates the affected tests to match. | 5 个月前 | |
module: pass data into helpers Update helper functions reached from module init/cleanup paths so callers pass the module-owned fields they use, or the module data pointer when several fields are needed. This removes extra neomutt_get_module_data() lookups from attach, autocrypt, color, conn, gui, history, hooks, key, menu, ncrypt, and sidebar helpers, and updates the affected tests to match. | 5 个月前 | |
array: allow nested ARRAY_FOREACH Change the ARRAY_FOREACH() loop variable from ARRAY_FOREACH_IDX to a "templated" name ARRAY_FOREACH_IDX_ + elem variable. | 1 年前 | |
sort: free Alias Create Alias-specific sort methods: - ALIAS_SORT_ALIAS, ///< Sort by Alias short name - ALIAS_SORT_EMAIL, ///< Sort by Email Address - ALIAS_SORT_NAME, ///< Sort by Real Name - ALIAS_SORT_UNSORTED, ///< Sort by the order the Aliases were configured Symbols dropped from config/sort.h: - SORT_ALIAS - SORT_EMAIL - SORT_NAME | 1 年前 |