Open nurupo opened 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 73.09%. Comparing base (
fa20168
) to head (395e048
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@JFreegman please take a look and merge.
Oh, wrong PR, sorry.
A continuation of the cleanup done in https://github.com/TokTok/c-toxcore/pull/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 b7404f24f63054c00c26abab4bd0b9dc58f96efb, 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*int
parameter to return a boolean value, as libconfig still uses C89. This commit adds a wrapper function around libconfig'sconfig_lookup_bool()
that takes a*bool
instead, eliminating the remaining boolean ints and majority of the explicit int-to-bool conversions in tox-bootstrapd.This change is