HomeClusterLabs Projects

API: libcrmcommon: Several crm_time_t args in iso8601.c are now const

Description

API: libcrmcommon: Several crm_time_t args in iso8601.c are now const

This affects the following four public API functions:

  • crm_time_as_string()
  • crm_time_log_alias()
  • crm_time_get_seconds()
  • crm_time_get_seconds_since_epoch()

It was necessary to update all four of these functions in a single
commit.

  1. crm_time_as_string(), crm_time_get_seconds(), and crm_time_get_seconds_since_epoch() all call the static function crm_get_utc_time().
  2. crm_get_utc_time() calls crm_time_log_alias().
  3. crm_time_log_alias() calls crm_time_as_string().
  4. crm_time_as_string() can call crm_time_get_seconds() or crm_time_get_seconds_since_epoch().

So if any of them take a const crm_time_t pointer, all of them must be
updated to take a const pointer.

This is backward-compatible since a non-const pointer can be passed as a
const pointer argument.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Aug 25 2022, 8:37 PM
Parents
rP2fa81430b8f2: API: libcrmcommon: dt argument of crm_time_get_isoweek() is now const
Branches
Unknown
Tags
Unknown