]> git.ipfire.org Git - thirdparty/bind9.git/commit
Implement isc_interval_t on top of isc_time_t
authorOndřej Surý <ondrej@isc.org>
Sun, 13 Mar 2022 11:13:11 +0000 (12:13 +0100)
committerEvan Hunt <each@isc.org>
Mon, 14 Mar 2022 20:00:05 +0000 (13:00 -0700)
commit79b5ccbf34cffcc7d89b9c978b383f5000f0e4ad
tree81b04799dc59083adc0a6d258ce1818766dad852
parente6ca2a651f034503eab855fd52ee69f49c903d79
Implement isc_interval_t on top of isc_time_t

Change the isc_interval_t implementation from separate data type and
separate implementation to be shim implementation on top of isc_time_t.
The distinction between isc_interval_t and isc_time_t has been kept
because they are semantically different - isc_interval_t is relative and
isc_time_t is absolute, but this allows isc_time_t and isc_interval_t to
be freely interchangeable, f.e. this:

    isc_time_t *t1;
    isc_interval_t *interval;
    isc_time_t *t2;

    isc_interval_set(interval, isc_time_seconds(t2), isc_time_nanoseconds(t2);;
    isc_time_subtract(t1, interval, t2);
    isc_interval_set(interval, isc_time_seconds(t2), isc_time_nanoseconds(t2));

to just:

    isc_time_t *t1;
    isc_interval_t *interval;
    isc_time_t *t2;

    isc_time_subtract(t1, t2, interval);

without introducing a whole set of new functions.
lib/dns/resolver.c
lib/dns/zone.c
lib/isc/include/isc/ratelimiter.h
lib/isc/include/isc/time.h
lib/isc/include/isc/types.h
lib/isc/time.c