diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:42:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:56:54 +0100 |
commit | 5d180d1f996ead27f9c5cb3db7f91e293de34d9d (patch) | |
tree | e881854dac5d749518562970d6194a0ef65736ec /Userland/Utilities/ntpquery.cpp | |
parent | b33a6a443e700cd80325d312f21c985b0687bb97 (diff) | |
download | serenity-5d180d1f996ead27f9c5cb3db7f91e293de34d9d.zip |
Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
Diffstat (limited to 'Userland/Utilities/ntpquery.cpp')
-rw-r--r-- | Userland/Utilities/ntpquery.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Utilities/ntpquery.cpp b/Userland/Utilities/ntpquery.cpp index 07003b4f38..692a5b4d54 100644 --- a/Userland/Utilities/ntpquery.cpp +++ b/Userland/Utilities/ntpquery.cpp @@ -74,7 +74,7 @@ const unsigned SecondsFrom1900To1970 = (70u * 365u + 70u / 4u) * 24u * 60u * 60u static NtpTimestamp ntp_timestamp_from_timeval(const timeval& t) { - ASSERT(t.tv_usec >= 0 && t.tv_usec < 1'000'000); // Fits in 20 bits when normalized. + VERIFY(t.tv_usec >= 0 && t.tv_usec < 1'000'000); // Fits in 20 bits when normalized. // Seconds just need translation to the different origin. uint32_t seconds = t.tv_sec + SecondsFrom1900To1970; @@ -100,9 +100,9 @@ static String format_ntp_timestamp(NtpTimestamp ntp_timestamp) struct tm tm; gmtime_r(&t.tv_sec, &tm); size_t written = strftime(buffer, sizeof(buffer), "%Y-%m-%dT%T.", &tm); - ASSERT(written == 20); + VERIFY(written == 20); written += snprintf(buffer + written, sizeof(buffer) - written, "%06d", (int)t.tv_usec); - ASSERT(written == 26); + VERIFY(written == 26); buffer[written++] = 'Z'; buffer[written] = '\0'; return buffer; @@ -231,9 +231,9 @@ int main(int argc, char** argv) } cmsghdr* cmsg = CMSG_FIRSTHDR(&msg); - ASSERT(cmsg->cmsg_level == SOL_SOCKET); - ASSERT(cmsg->cmsg_type == SCM_TIMESTAMP); - ASSERT(!CMSG_NXTHDR(&msg, cmsg)); + VERIFY(cmsg->cmsg_level == SOL_SOCKET); + VERIFY(cmsg->cmsg_type == SCM_TIMESTAMP); + VERIFY(!CMSG_NXTHDR(&msg, cmsg)); timeval kernel_receive_time; memcpy(&kernel_receive_time, CMSG_DATA(cmsg), sizeof(kernel_receive_time)); |