]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
time: remove unused function
authorVictor Julien <vjulien@oisf.net>
Sat, 12 Oct 2024 04:59:37 +0000 (06:59 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 25 Oct 2024 05:47:11 +0000 (07:47 +0200)
It tripped up cppcheck:

src/util-time.h:124:35: error: syntax error [syntaxError]
    return !timercmp(first, second, >);

src/util-time.h

index a537a9a864125e06d7585b83c00ff6b3182357be..d2de7cb8db3f00948ea8989e33437f563b0a0f73 100644 (file)
@@ -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 {                                                                                           \