summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-30 19:30:49 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-30 20:57:13 -0700
commitaa4df026d44bd205f8bfce8a3b8d6a1144332f32 (patch)
tree397692da57b2be8f7c083989ed37fb03308d5b2c /src/net
parent7c5c2058e9aea996dc6c76a7e6d9ba4fc2a2bc77 (diff)
downloadtmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.gz
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.bz2
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.xz
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.zip
Finally get around to decoupling the warning system
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ip_test.cpp2
-rw-r--r--src/net/socket.cpp26
2 files changed, 11 insertions, 17 deletions
diff --git a/src/net/ip_test.cpp b/src/net/ip_test.cpp
index c2095ee..419dc03 100644
--- a/src/net/ip_test.cpp
+++ b/src/net/ip_test.cpp
@@ -30,8 +30,6 @@
namespace tmwa
{
-#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
-
#define CB(X) (std::integral_constant<bool, (X)>::value)
TEST(ip4addr, cmp)
{
diff --git a/src/net/socket.cpp b/src/net/socket.cpp
index 548d3c6..a01cd81 100644
--- a/src/net/socket.cpp
+++ b/src/net/socket.cpp
@@ -55,11 +55,11 @@ const uint32_t RFIFO_SIZE = 65536;
static
const uint32_t WFIFO_SIZE = 65536;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
+DIAG_PUSH();
+DIAG_I(old_style_cast);
static
std::array<std::unique_ptr<Session>, FD_SETSIZE> session;
-#pragma GCC diagnostic pop
+DIAG_POP();
Session::Session(SessionIO io, SessionParsers p)
: created()
@@ -269,14 +269,12 @@ Session *make_listen_port(uint16_t port, SessionParsers inferior)
fd.setsockopt(IPPROTO_TCP, TCP_NODELAY, &yes, sizeof yes);
server_address.sin_family = AF_INET;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#if __GNUC__ > 4 || __GNUC_MINOR__ >= 8
-# pragma GCC diagnostic ignored "-Wuseless-cast"
-#endif
+ DIAG_PUSH();
+ DIAG_I(old_style_cast);
+ DIAG_I(useless_cast);
server_address.sin_addr.s_addr = htonl(INADDR_ANY);
server_address.sin_port = htons(port);
-#pragma GCC diagnostic pop
+ DIAG_POP();
if (fd.bind(reinterpret_cast<struct sockaddr *>(&server_address),
sizeof(server_address)) == -1)
@@ -330,13 +328,11 @@ Session *make_connection(IP4Address ip, uint16_t port, SessionParsers parsers)
server_address.sin_family = AF_INET;
server_address.sin_addr = in_addr(ip);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#if __GNUC__ > 4 || __GNUC_MINOR__ >= 8
-# pragma GCC diagnostic ignored "-Wuseless-cast"
-#endif
+ DIAG_PUSH();
+ DIAG_I(old_style_cast);
+ DIAG_I(useless_cast);
server_address.sin_port = htons(port);
-#pragma GCC diagnostic pop
+ DIAG_POP();
fd.fcntl(F_SETFL, O_NONBLOCK);