Project

General

Profile

Feature #468 ยป 0070-timing.c-Replace-parameter-checking-fc_asserts-with-.patch

Marko Lindqvist, 05/04/2024 04:44 PM

View differences:

utility/timing.c
***********************************************************************/
void timer_clear(struct timer *t)
{
fc_assert_ret(t != nullptr);
t->state = TIMER_STOPPED;
t->sec = 0.0;
t->usec = 0;
......
***********************************************************************/
void timer_start(struct timer *t)
{
fc_assert_ret(t != nullptr);
if (t->use == TIMER_IGNORE) {
return;
}
......
***********************************************************************/
void timer_stop(struct timer *t)
{
fc_assert_ret(t != nullptr);
if (t->use == TIMER_IGNORE) {
return;
}
......
***********************************************************************/
double timer_read_seconds(struct timer *t)
{
fc_assert_ret_val(t != nullptr, -1.0);
if (t->use == TIMER_IGNORE) {
return 0.0;
}
......
long elapsed_usec;
long wait_usec;
fc_assert_ret(t != nullptr);
ret = gettimeofday(&tv_now, nullptr);
if ((ret == -1)
utility/timing.h
void timer_destroy(struct timer *t);
bool timer_in_use(struct timer *t);
void timer_clear(struct timer *t);
void timer_start(struct timer *t);
void timer_stop(struct timer *t);
double timer_read_seconds(struct timer *t);
void timer_usleep_since_start(struct timer *t, long usec);
void timer_clear(struct timer *t)
fc__attribute((nonnull (1)));
void timer_start(struct timer *t)
fc__attribute((nonnull (1)));
void timer_stop(struct timer *t)
fc__attribute((nonnull (1)));
double timer_read_seconds(struct timer *t)
fc__attribute((nonnull (1)));
void timer_usleep_since_start(struct timer *t, long usec)
fc__attribute((nonnull (1)));
#ifdef __cplusplus
}
    (1-1/1)