From ec21450522e3c2124f3510eef5cfd88420483248 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 26 Jun 2014 18:18:01 -0700 Subject: Low hanging fruit --- src/net/ip_test.cpp | 3 +++ src/net/socket.cpp | 2 +- src/net/timer.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/ip_test.cpp b/src/net/ip_test.cpp index 3c4d2ef..9058804 100644 --- a/src/net/ip_test.cpp +++ b/src/net/ip_test.cpp @@ -27,6 +27,9 @@ #include "../poison.hpp" + +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" + #define CB(X) (std::integral_constant::value) TEST(ip4addr, cmp) { diff --git a/src/net/socket.cpp b/src/net/socket.cpp index 54f9822..6e523de 100644 --- a/src/net/socket.cpp +++ b/src/net/socket.cpp @@ -431,7 +431,7 @@ void do_sendrecv(interval_t next_ms) timeout.tv_sec = next_s.count(); timeout.tv_usec = next_us.count(); } - if (io::FD_Set::select(fd_max, &rfd, &wfd, NULL, &timeout) <= 0) + if (io::FD_Set::select(fd_max, &rfd, &wfd, nullptr, &timeout) <= 0) return; for (io::FD i : iter_fds()) { diff --git a/src/net/timer.cpp b/src/net/timer.cpp index a85b8be..64077c6 100644 --- a/src/net/timer.cpp +++ b/src/net/timer.cpp @@ -74,7 +74,7 @@ tick_t milli_clock::now(void) noexcept struct timeval tval; // BUG: This will cause strange behavior if the system clock is changed! // it should be reimplemented in terms of clock_gettime(CLOCK_MONOTONIC, ) - gettimeofday(&tval, NULL); + gettimeofday(&tval, nullptr); return gettick_cache = tick_t(std::chrono::seconds(tval.tv_sec) + std::chrono::duration_cast( std::chrono::microseconds(tval.tv_usec))); -- cgit v1.2.3-60-g2f50