Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2093

Use the C "bool" type for true/false function returns

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.7.0
    • Affects Version/s: None
    • Component/s: None
    • None

      In a recent code review, there was some discussion about when function returns should be compared against an explicit zero vs if (!func()). The answer is if the function is returning a boolean, but WT has mapped that to the int type for portability.

      However, C has had a bool type since C99 via <stdbool.h>, also supported by Visual Studio 2013 and above.

      Investigate converting WT to use explicit bool types to make it clear when expressions need to be compared against zero.

            Assignee:
            Unassigned Unassigned
            Reporter:
            michael.cahill@mongodb.com Michael Cahill (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: