Change the NS_PER_SEC (and friends) from enum to static const
New version of clang (19) has introduced a stricter checks when mixing
integer (and float types) with enums. In this case, we used enum {}
as C17 doesn't have constexpr yet. Change the time conversion constants
to be static const unsigned int instead of enum values.
This commit is contained in:
@@ -203,8 +203,8 @@ void
|
||||
dns_test_nap(uint32_t usec) {
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = usec / 1000000;
|
||||
ts.tv_nsec = (usec % 1000000) * 1000;
|
||||
ts.tv_sec = usec / (long)US_PER_SEC;
|
||||
ts.tv_nsec = (usec % (long)US_PER_SEC) * (long)NS_PER_US;
|
||||
nanosleep(&ts, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user