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

Literal values should use WT defines if possible

    • Type: Icon: Technical Debt Technical Debt
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.2.0, 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      In WiredTiger, we have several literal defines for numbers so that we don't have to count zeroes and hope it is correct. In src/include/misc.h we have WT_THOUSAND, WT_MILLION, WT_BILLION.

      We should make a pass through the source tree (and test programs, but not example programs, nor extensions) and replace any mis-uses of literal numbers with the appropriate use of the define.

      For example, in src/log/log.c there are several calls to wt_cond_wait like:

      __wt_cond_wait(session, log->log_sync_cond, 10000, NULL);
      

      that should be modified like:

      __wt_cond_wait(session, log->log_sync_cond, 10 * WT_THOUSAND, NULL);
      

            Assignee:
            peter.macko@mongodb.com Peter Macko
            Reporter:
            sue.loverso@mongodb.com Susan LoVerso
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: