Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-4275

Duration uses fixed-width types inconsistently

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.27.0
    • stout
    • Mesosphere Sprint 26
    • 2

    Description

      The implementation of the Duration class correctly uses fixed-width types (here int64_t) for portability internally, but uses long types in a few places (in particular LLONG_MIN and LLONG_MAX). This is inconsistent on 64-bit platforms, and probably incorrect on 32-bit as there long is 32 bit wide.

      Additionally, the longer Duration types (Minutes, Hours, Days, and Weeks) construct from int32_t, while shorter ones take int64_t. Probably as a left-over this is matched with a redundant Duration constructor taking an int32_t value where the other one taking an int64_t value would be sufficient. It should be safe to just construct from int64_t in all places.

      Attachments

        Activity

          People

            bbannier Benjamin Bannier
            bbannier Benjamin Bannier
            Michael Park Michael Park
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: