Opened 15 months ago
Last modified 15 months ago
#27661 new defect
use C99 bool from stdbool.h instead of int everywhere
Reported by: | cyberpunks | Owned by: | |
---|---|---|---|
Priority: | Medium | Milestone: | Tor: unspecified |
Component: | Core Tor/Tor | Version: | |
Severity: | Normal | Keywords: | coccinelle, tor-client, technical-debt, c99 |
Cc: | mcs, teor, ahf, catalyst | Actual Points: | |
Parent ID: | #13260 | Points: | |
Reviewer: | Sponsor: |
Description
Child Tickets
Change History (2)
comment:1 Changed 15 months ago by
comment:2 Changed 15 months ago by
I'm fine with returning a bool from functions that are logically boolean, but we shouldn't change the convention for functions where "0" indicates success and "-1" indicates an error.
Note: See
TracTickets for help on using
tickets.
When returning a boolean from a function, bool is the best we can do.
In a struct, a 1-bit field is better (
unsigned int foo : 1
).