Skip to content

Refactor void* casting to specific types, indentations and other noisy stuff#3297

Merged
jimklimov merged 16 commits intonetworkupstools:masterfrom
jimklimov:issue-3293-refactoring
Feb 4, 2026
Merged

Refactor void* casting to specific types, indentations and other noisy stuff#3297
jimklimov merged 16 commits intonetworkupstools:masterfrom
jimklimov:issue-3293-refactoring

Conversation

@jimklimov
Copy link
Member

@jimklimov jimklimov commented Feb 2, 2026

Inspired by changes in PR #3293 by @timn that were needed to build the NUT code base with the new and ever more picky clang-21 compiler version, and test that PR's own merits.

Overall this was a lot of noise for hopefully idempotent code base change, which obscured modifications related to that PR, so posting as a separate big refactoring wad (and adding some indentation fixes etc. as mangled by edits of the original commits.

@jimklimov jimklimov added this to the 2.8.5 milestone Feb 2, 2026
@jimklimov jimklimov added CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings portability We want NUT to build and run everywhere possible labels Feb 2, 2026
timn and others added 16 commits February 2, 2026 16:56
This fixes the build fail triggered on CI farm, and some more that
trigger on the more recent version 21 of clang.

Signed-off-by: Tim Niemueller <tim@niemueller.de>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
On the used clang version implicit conversion triggers a warning, the
`-Werror` makes those errors.

I have used Gemini for some of these, but quota ran out after half an hour and
~120 invocations so I completed the rest manually.

Signed-off-by: Tim Niemueller <tim@niemueller.de>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Kudos to Tim Niemueller, Gemini, and clang-21 extended warnings.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…apping table entry types etc. via enum values [networkupstools#3293]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ture and method arguments

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ULLness at the beginning of main() [networkupstools#3293]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…the iteration variable name

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ng of xmalloc() [networkupstools#3293]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Bonus question: what could Gemini mean by "FTS"?..

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…mge_model_names[] [networkupstools#3293]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… *)1` also in comparisons

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…IPMI on this host" to report the message

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the issue-3293-refactoring branch from 0ef9d1a to 838c162 Compare February 2, 2026 15:57
@AppVeyorBot
Copy link

@jimklimov jimklimov force-pushed the issue-3293-refactoring branch 4 times, most recently from dd99e43 to 838c162 Compare February 2, 2026 18:38
@AppVeyorBot
Copy link

@jimklimov jimklimov added C-str Issues and PRs about C/C++ methods, headers and data types dealing with strings and memory blocks C-bool Issues and PRs about C/C++ methods, headers and data types dealing with boolean types labels Feb 3, 2026
@jimklimov jimklimov merged commit b242696 into networkupstools:master Feb 4, 2026
84 of 95 checks passed
@jimklimov jimklimov deleted the issue-3293-refactoring branch February 4, 2026 08:36
@jimklimov jimklimov added the AI For good or bad, machine tools are upon us. Humans are still the responsible ones. label Feb 5, 2026
jimklimov added a commit to jimklimov/nut that referenced this pull request Feb 8, 2026
…/generic_gpio_utest.c: fix more casting from xcalloc() et al [networkupstools#3297]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Feb 8, 2026
… et al [networkupstools#3297]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Feb 8, 2026
…t assign plain number to enum variables [networkupstools#3297]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI For good or bad, machine tools are upon us. Humans are still the responsible ones. C-bool Issues and PRs about C/C++ methods, headers and data types dealing with boolean types C-str Issues and PRs about C/C++ methods, headers and data types dealing with strings and memory blocks CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) portability We want NUT to build and run everywhere possible refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants