Skip to content

Commit

Permalink
time: remove unused function
Browse files Browse the repository at this point in the history
It tripped up cppcheck:

src/util-time.h:124:35: error: syntax error [syntaxError]
    return !timercmp(first, second, >);
  • Loading branch information
victorjulien committed Oct 25, 2024
1 parent 3f85add commit bdc0df8
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/util-time.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,6 @@ SCTime_t TimeGet(void);
/** \brief initialize a 'struct timespec' from a 'struct timeval'. */
#define FROM_TIMEVAL(timev) { .tv_sec = (timev).tv_sec, .tv_nsec = (timev).tv_usec * 1000 }

/** \brief compare two 'struct timeval' and return if the first is earlier than the second */
static inline bool TimevalEarlier(struct timeval *first, struct timeval *second)
{
/* from man timercmp on Linux: "Some systems (but not Linux/glibc), have a broken timercmp()
* implementation, in which CMP of >=, <=, and == do not work; portable applications can instead
* use ... !timercmp(..., >) */
return !timercmp(first, second, >);
}

#ifndef timeradd
#define timeradd(a, b, r) \
do { \
Expand Down

0 comments on commit bdc0df8

Please sign in to comment.