Skip to content

Refactor: boolean settings not treated as booleans #2421

Open
@jimklimov

Description

@jimklimov

Some drivers (e.g. nutdrv_qx core or certain subdrivers) have options with values enabled/disabled that are magically parsed (with strchr('d') or similar) instead of just being booleans (with several standard string tokens per meaning) supported by NUT for a long time.

Revise the code for such cases and convert to common booleans where applicable. Perhaps add understanding of enabled/disabled as true/false to the common parsers, for backwards compatibility of existing configs.

Discovered during work on #2294.

See also #2811.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-boolIssues and PRs about C/C++ methods, headers and data types dealing with boolean typesC-strIssues and PRs about C/C++ methods, headers and data types dealing with strings and memory blocksQx protocol driverDriver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some othersimpacts-release-2.8.2Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks)portabilityWe want NUT to build and run everywhere possiblerefactor/fightwarnPR or issue proposal to improve code maintainability without functional changes, or to fix warnings

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions