Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
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.