-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor code from custom bool_t to stdbool.h (where available) #1176
Labels
C-bool
Issues and PRs about C/C++ methods, headers and data types dealing with boolean types
refactor/fightwarn
PR or issue proposal to improve code maintainability without functional changes, or to fix warnings
Milestone
Comments
jimklimov
added
the
refactor/fightwarn
PR or issue proposal to improve code maintainability without functional changes, or to fix warnings
label
Nov 14, 2021
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Nov 20, 2021
…n of bool_t" This reverts commit ffc7bce. In some build scenarios it ends up not defined. Defer solution to upstream NUT issue networkupstools#1176
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Nov 20, 2021
…n of bool_t" This reverts commit ffc7bce. In some build scenarios it ends up not defined. Defer solution to upstream NUT issue networkupstools#1176
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Nov 20, 2021
…n of bool_t" This reverts commit ffc7bce. In some build scenarios it ends up not defined. Defer solution to upstream NUT issue networkupstools#1176
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Nov 20, 2021
…n of bool_t" This reverts commit ffc7bce. In some build scenarios it ends up not defined. Defer solution to upstream NUT issue networkupstools#1176
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jan 17, 2022
…n of bool_t" This reverts commit ffc7bce. In some build scenarios it ends up not defined. Defer solution to upstream NUT issue networkupstools#1176
jimklimov
added
the
C-bool
Issues and PRs about C/C++ methods, headers and data types dealing with boolean types
label
Apr 10, 2024
34 tasks
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 16, 2024
….h> and/or <float.h> [networkupstools#1176] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 16, 2024
…test.c et al: introduce a NUT_CHECK_BOOL scriptlet and a header with nut_bool_t type [networkupstools#1176] Chose to use a unique type name to avoid conflicts with third-party headers which deliver a `bool_t` (currently commonly hacked into many NUT sources). Using lower-cased `true` and `false` values, hoping for maximum compatibility with C99 and newer language standards (if the compilers do implement them on whatever obscure platform NUT gets built on, and then our new `nut_bool_t` definition can be just an alias for what the language gives us). A test case was added to make sure it behaves as expected on different systems. Converting the sources from their custom type definitions and usages would be a separate step. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 19, 2024
…lean type/value usage [networkupstools#1176] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jul 19, 2024
…ent [networkupstools#1176] 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
C-bool
Issues and PRs about C/C++ methods, headers and data types dealing with boolean types
refactor/fightwarn
PR or issue proposal to improve code maintainability without functional changes, or to fix warnings
Currently many places in codebase copy around a definition of a
bool_t
as enum or int; there are few uses ofstdbool.h
that should have handled the type.I suppose we have legacy systems to consider that might not have this header yet, so maybe a
nut_stdbool.h
(similar in purpose and construct totimehead.h
andnut_stdint.h
) is in order, to streamline this basic type definition and use.UPDATE: See also, some prior art found:
FTY
branch differences frommaster
, see Upstreaming improvements from 42ity/nut fork #1316The text was updated successfully, but these errors were encountered: