diff --git a/CHANGES b/CHANGES index bc9e223f0c..ebc5c5d24b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3379. [bug] isc_interval_zero and isc_time_epoch should be + "const (type)* const". [RT #31069] + 3378. [bug] Handle missing 'managed-keys-directory' better. [RT #30625] diff --git a/lib/isc/include/isc/timer.h b/lib/isc/include/isc/timer.h index fa9abb16aa..79c4fe5ed1 100644 --- a/lib/isc/include/isc/timer.h +++ b/lib/isc/include/isc/timer.h @@ -108,8 +108,8 @@ typedef struct { void (*destroy)(isc_timermgr_t **managerp); isc_result_t (*timercreate)(isc_timermgr_t *manager, isc_timertype_t type, - isc_time_t *expires, - isc_interval_t *interval, + const isc_time_t *expires, + const isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, const void *arg, @@ -120,7 +120,8 @@ typedef struct { void (*attach)(isc_timer_t *timer, isc_timer_t **timerp); void (*detach)(isc_timer_t **timerp); isc_result_t (*reset)(isc_timer_t *timer, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, + const isc_time_t *expires, + const isc_interval_t *interval, isc_boolean_t purge); isc_result_t (*touch)(isc_timer_t *timer); } isc_timermethods_t; @@ -168,8 +169,8 @@ struct isc_timer { isc_result_t isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type, - isc_time_t *expires, - isc_interval_t *interval, + const isc_time_t *expires, + const isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, const void *arg, @@ -232,8 +233,8 @@ isc_timer_create(isc_timermgr_t *manager, isc_result_t isc_timer_reset(isc_timer_t *timer, isc_timertype_t type, - isc_time_t *expires, - isc_interval_t *interval, + const isc_time_t *expires, + const isc_interval_t *interval, isc_boolean_t purge); /*%< * Change the timer's type, expires, and interval values to the given diff --git a/lib/isc/timer.c b/lib/isc/timer.c index 0da251f4c3..0c80c1f980 100644 --- a/lib/isc/timer.c +++ b/lib/isc/timer.c @@ -130,12 +130,12 @@ struct isc__timermgr { ISC_TIMERFUNC_SCOPE isc_result_t isc__timer_create(isc_timermgr_t *manager, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, + const isc_time_t *expires, const isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp); ISC_TIMERFUNC_SCOPE isc_result_t isc__timer_reset(isc_timer_t *timer, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, + const isc_time_t *expires, const isc_interval_t *interval, isc_boolean_t purge); ISC_TIMERFUNC_SCOPE isc_timertype_t isc__timer_gettype(isc_timer_t *timer); @@ -392,7 +392,7 @@ destroy(isc__timer_t *timer) { ISC_TIMERFUNC_SCOPE isc_result_t isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, + const isc_time_t *expires, const isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp) { @@ -514,7 +514,7 @@ isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type, ISC_TIMERFUNC_SCOPE isc_result_t isc__timer_reset(isc_timer_t *timer0, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, + const isc_time_t *expires, const isc_interval_t *interval, isc_boolean_t purge) { isc__timer_t *timer = (isc__timer_t *)timer0; diff --git a/lib/isc/timer_api.c b/lib/isc/timer_api.c index 97e62b3f0e..c9d91c33aa 100644 --- a/lib/isc/timer_api.c +++ b/lib/isc/timer_api.c @@ -96,7 +96,7 @@ isc_timermgr_destroy(isc_timermgr_t **managerp) { isc_result_t isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, + const isc_time_t *expires, const isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp) { @@ -128,7 +128,7 @@ isc_timer_detach(isc_timer_t **timerp) { isc_result_t isc_timer_reset(isc_timer_t *timer, isc_timertype_t type, - isc_time_t *expires, isc_interval_t *interval, + const isc_time_t *expires, const isc_interval_t *interval, isc_boolean_t purge) { REQUIRE(ISCAPI_TIMER_VALID(timer)); diff --git a/lib/isc/unix/include/isc/time.h b/lib/isc/unix/include/isc/time.h index dc1cef9ad3..9090929b15 100644 --- a/lib/isc/unix/include/isc/time.h +++ b/lib/isc/unix/include/isc/time.h @@ -41,7 +41,7 @@ struct isc_interval { unsigned int nanoseconds; }; -extern isc_interval_t *isc_interval_zero; +extern const isc_interval_t * const isc_interval_zero; ISC_LANG_BEGINDECLS @@ -85,7 +85,7 @@ struct isc_time { unsigned int nanoseconds; }; -extern isc_time_t *isc_time_epoch; +extern const isc_time_t * const isc_time_epoch; void isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds); diff --git a/lib/isc/unix/time.c b/lib/isc/unix/time.c index ac23ae0928..e820afb1ea 100644 --- a/lib/isc/unix/time.c +++ b/lib/isc/unix/time.c @@ -54,8 +54,8 @@ *** Intervals ***/ -static isc_interval_t zero_interval = { 0, 0 }; -isc_interval_t *isc_interval_zero = &zero_interval; +static const isc_interval_t zero_interval = { 0, 0 }; +const isc_interval_t * const isc_interval_zero = &zero_interval; #if ISC_FIX_TV_USEC static inline void @@ -110,8 +110,8 @@ isc_interval_iszero(const isc_interval_t *i) { *** Absolute Times ***/ -static isc_time_t epoch = { 0, 0 }; -isc_time_t *isc_time_epoch = &epoch; +static const isc_time_t epoch = { 0, 0 }; +const isc_time_t * const isc_time_epoch = &epoch; void isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds) { diff --git a/lib/isc/win32/include/isc/time.h b/lib/isc/win32/include/isc/time.h index 8ffb24b114..16be769e7e 100644 --- a/lib/isc/win32/include/isc/time.h +++ b/lib/isc/win32/include/isc/time.h @@ -39,7 +39,7 @@ struct isc_interval { isc_int64_t interval; }; -LIBISC_EXTERNAL_DATA extern isc_interval_t *isc_interval_zero; +LIBISC_EXTERNAL_DATA extern const isc_interval_t * const isc_interval_zero; ISC_LANG_BEGINDECLS @@ -82,7 +82,7 @@ struct isc_time { FILETIME absolute; }; -LIBISC_EXTERNAL_DATA extern isc_time_t *isc_time_epoch; +LIBISC_EXTERNAL_DATA extern const isc_time_t * const isc_time_epoch; void isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds); diff --git a/lib/isc/win32/time.c b/lib/isc/win32/time.c index aafd70b124..7ffd0de053 100644 --- a/lib/isc/win32/time.c +++ b/lib/isc/win32/time.c @@ -47,15 +47,15 @@ *** Absolute Times ***/ -static isc_time_t epoch = { { 0, 0 } }; -LIBISC_EXTERNAL_DATA isc_time_t *isc_time_epoch = &epoch; +static const isc_time_t epoch = { { 0, 0 } }; +LIBISC_EXTERNAL_DATA const isc_time_t * const isc_time_epoch = &epoch; /*** *** Intervals ***/ -static isc_interval_t zero_interval = { 0 }; -LIBISC_EXTERNAL_DATA isc_interval_t *isc_interval_zero = &zero_interval; +static const isc_interval_t zero_interval = { 0 }; +LIBISC_EXTERNAL_DATA const isc_interval_t * const isc_interval_zero = &zero_interval; void isc_interval_set(isc_interval_t *i, unsigned int seconds,