refactor: Make tox-bootstrapd use bool instead of int#2692
Merged
Conversation
nurupo
force-pushed
the
bootstrapd-int-to-bool
branch
from
February 17, 2024 00:41
2440c84 to
8dd785f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2692 +/- ##
==========================================
+ Coverage 73.03% 73.09% +0.06%
==========================================
Files 149 149
Lines 30531 30531
==========================================
+ Hits 22298 22318 +20
+ Misses 8233 8213 -20 ☔ View full report in Codecov by Sentry. |
nurupo
force-pushed
the
bootstrapd-int-to-bool
branch
from
February 17, 2024 00:49
8dd785f to
1a74c3d
Compare
iphydf
approved these changes
Mar 28, 2024
nurupo
marked this pull request as ready for review
March 29, 2024 10:46
nurupo
force-pushed
the
bootstrapd-int-to-bool
branch
from
March 29, 2024 10:48
1a74c3d to
395e048
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
A continuation of the cleanup done in b7404f2. tox-bootrstrapd historically had used ints for boolean values, as it was initially written in C89 which has no stdbool.h. Since then it has modernized and moved on to using C11, but the usage of the int type to represent boolean values, "boolean ints", remained. Recently, driven by a desire to eliminate implicit int-to-bool conversion, @iphydf did a cleanup in b7404f2, changing some of the boolean ints to bools and doing manual int-to-bool conversion on the remaining boolean ints. This left the codebase in an inconsistent state of both ints and bools now being used to represent boolean values, not to mention that the explicit int-to-bool conversions are a bit ugly. The only boolean ints that remained are those stemming from libconfig's config_lookup_bool() taking an *int parameter to return a boolean value, as libconfig still uses C89. This commit adds a wrapper function around libconfig's config_lookup_bool() that takes a *bool instead, eliminating the remaining boolean ints and majority of the explicit int-to-bool conversions in tox-bootstrapd.
nurupo
force-pushed
the
bootstrapd-int-to-bool
branch
from
November 7, 2024 10:43
395e048 to
5752fc2
Compare
iphydf
reviewed
Nov 7, 2024
iphydf
left a comment
Member
There was a problem hiding this comment.
Reviewed 4 of 4 files at r1.
Reviewable status:complete! 1 of 1 approvals obtained
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A continuation of the cleanup done in #2621.
tox-bootrstrapd historically had used ints for boolean values, as it was initially written in C89 which has no
stdbool.h. Since then it has modernized and moved on to using C11, but the usage of the int type to represent boolean values, "boolean ints", remained. Recently, driven by a desire to eliminate implicit int-to-bool conversion, @iphydf did a cleanup in b7404f2, changing some of the boolean ints to bools and doing manual int-to-bool conversion on the remaining boolean ints. This left the codebase in an inconsistent state of both ints and bools now being used to represent boolean values, not to mention that the explicit int-to-bool conversions are a bit ugly. The only boolean ints that remained are those stemming from libconfig'sconfig_lookup_bool()taking an*intparameter to return a boolean value, as libconfig still uses C89. This commit adds a wrapper function around libconfig'sconfig_lookup_bool()that takes a*boolinstead, eliminating the remaining boolean ints and majority of the explicit int-to-bool conversions in tox-bootstrapd.This change is