forked from irungentoo/toxcore
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Make tox-bootstrapd use bool instead of int
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.
- Loading branch information
Showing
4 changed files
with
56 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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