[neomutt-devel] Bool-ification of functions (please help)

Richard Russon rich at flatcap.org
Tue Mar 28 18:03:24 CEST 2017

The C standard C99 defines a boolean type `bool` and truth values `true`
and `false`.

A quick analysis of neomutt's code found ~230 functions that appear to
only have two possible return values.  They are candidates for being

The work will involve a bit of investigation and a little code editing.

After investigation, some functions won't be suitable:
- Analysis was wrong -- more return values
- Altering this function will mean altering many others

Example work:

- Function returns `1` or `0`
  - Change the returns to `true` or `false`
  - Check the callers test the return value correctly
  - Rename the function to make it more clearly boolean

- Function returns `0` or `-1` (a common occurrence)
  - Change the returns to `true` or `false`
  - Change the callers to accept `true` or `false`
  - Update the function comment
  - Rename the function to make it more clearly boolean

The list of functions can be found in the github issue:

There are 10 small sets functions and 18 bigger sets.

Please help.
    Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20170328/bc910f9c/attachment.sig>

More information about the neomutt-devel mailing list