summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-27 19:16:45 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-27 19:33:42 -0700
commit7af4c5b5c561362cb1135ab504095ae667a9270a (patch)
tree49ffd3008d7634ba36f3951493a68e928407ce89 /src/net
parent8d7f1dadeeb1dc1609b72de5a4ee3a5247b0e9e6 (diff)
downloadtmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.gz
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.bz2
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.xz
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.zip
This is more reliable
Diffstat (limited to 'src/net')
-rw-r--r--src/net/fwd.hpp7
-rw-r--r--src/net/ip.hpp15
-rw-r--r--src/net/packets.hpp19
-rw-r--r--src/net/socket.hpp33
-rw-r--r--src/net/timer.hpp11
-rw-r--r--src/net/timer.t.hpp17
6 files changed, 42 insertions, 60 deletions
diff --git a/src/net/fwd.hpp b/src/net/fwd.hpp
index 2438ccf..2097772 100644
--- a/src/net/fwd.hpp
+++ b/src/net/fwd.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_NET_FWD_HPP
-#define TMWA_NET_FWD_HPP
+#pragma once
// net/fwd.hpp - list of type names for net lib
//
// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,7 +18,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "../sanity.hpp"
+#include "../sanity.hpp"
namespace tmwa
@@ -32,5 +31,3 @@ class TimerData;
enum class RecvResult;
} // namespace tmwa
-
-#endif // TMWA_NET_FWD_HPP
diff --git a/src/net/ip.hpp b/src/net/ip.hpp
index 9afc691..e9e71f4 100644
--- a/src/net/ip.hpp
+++ b/src/net/ip.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_NET_IP_HPP
-#define TMWA_NET_IP_HPP
+#pragma once
// ip.hpp - classes to deal with IP addresses.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,14 +18,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "fwd.hpp"
+#include "fwd.hpp"
-# include <netinet/in.h>
+#include <netinet/in.h>
-# include <cstddef>
-# include <cstdint>
+#include <cstddef>
+#include <cstdint>
-# include "../strings/fwd.hpp"
+#include "../strings/fwd.hpp"
namespace tmwa
@@ -165,5 +164,3 @@ bool extract(XString str, IP4Address *iv);
bool extract(XString str, IP4Mask *iv);
} // namespace tmwa
-
-#endif // TMWA_NET_IP_HPP
diff --git a/src/net/packets.hpp b/src/net/packets.hpp
index e025a63..5cc377c 100644
--- a/src/net/packets.hpp
+++ b/src/net/packets.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_NET_PACKETS_HPP
-#define TMWA_NET_PACKETS_HPP
+#pragma once
// packets.hpp - palatable socket buffer accessors
//
// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,20 +18,20 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "fwd.hpp"
+#include "fwd.hpp"
-# include <vector>
+#include <vector>
-# include "../compat/cast.hpp"
+#include "../compat/cast.hpp"
-# include "../ints/little.hpp"
+#include "../ints/little.hpp"
-# include "../io/fwd.hpp"
+#include "../io/fwd.hpp"
// TODO ordering violation, should invert
-# include "../proto2/fwd.hpp"
+#include "../proto2/fwd.hpp"
-# include "socket.hpp"
+#include "socket.hpp"
namespace tmwa
@@ -584,5 +583,3 @@ RecvResult recv_packet_repeatonly(Session *s, AString& repeat)
return recv_vpacket<id, 4, repeatsize>(s, head, repeat);
}
} // namespace tmwa
-
-#endif // TMWA_NET_PACKETS_HPP
diff --git a/src/net/socket.hpp b/src/net/socket.hpp
index 64eaf1a..576ef85 100644
--- a/src/net/socket.hpp
+++ b/src/net/socket.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_NET_SOCKET_HPP
-#define TMWA_NET_SOCKET_HPP
+#pragma once
// socket.hpp - Network event system.
//
// Copyright © ????-2004 Athena Dev Teams
@@ -21,28 +20,28 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "fwd.hpp"
+#include "fwd.hpp"
-# include <algorithm>
+#include <algorithm>
-# include <sys/select.h>
+#include <sys/select.h>
-# include <memory>
+#include <memory>
-# include "../compat/iter.hpp"
-# include "../compat/rawmem.hpp"
-# include "../compat/time_t.hpp"
+#include "../compat/iter.hpp"
+#include "../compat/rawmem.hpp"
+#include "../compat/time_t.hpp"
-# include "../strings/astring.hpp"
-# include "../strings/vstring.hpp"
-# include "../strings/xstring.hpp"
+#include "../strings/astring.hpp"
+#include "../strings/vstring.hpp"
+#include "../strings/xstring.hpp"
-# include "../generic/dumb_ptr.hpp"
+#include "../generic/dumb_ptr.hpp"
-# include "../io/fd.hpp"
+#include "../io/fd.hpp"
-# include "ip.hpp"
-# include "timer.t.hpp"
+#include "ip.hpp"
+#include "timer.t.hpp"
namespace tmwa
@@ -176,5 +175,3 @@ void do_sendrecv(interval_t next);
/// Call the parser function for every socket that has read data
void do_parsepacket(void);
} // namespace tmwa
-
-#endif // TMWA_NET_SOCKET_HPP
diff --git a/src/net/timer.hpp b/src/net/timer.hpp
index beda3bf..338e339 100644
--- a/src/net/timer.hpp
+++ b/src/net/timer.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_NET_TIMER_HPP
-#define TMWA_NET_TIMER_HPP
+#pragma once
// timer.hpp - Future event scheduler.
//
// Copyright © ????-2004 Athena Dev Teams
@@ -21,11 +20,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "timer.t.hpp"
+#include "timer.t.hpp"
-# include "fwd.hpp"
+#include "fwd.hpp"
-# include "../strings/fwd.hpp"
+#include "../strings/fwd.hpp"
namespace tmwa
@@ -50,5 +49,3 @@ tick_t file_modified(ZString name);
/// Check if there are any events at all scheduled.
bool has_timers();
} // namespace tmwa
-
-#endif // TMWA_NET_TIMER_HPP
diff --git a/src/net/timer.t.hpp b/src/net/timer.t.hpp
index 5961f51..e983e07 100644
--- a/src/net/timer.t.hpp
+++ b/src/net/timer.t.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_NET_TIMER_T_HPP
-#define TMWA_NET_TIMER_T_HPP
+#pragma once
// timer.t.hpp - Future event scheduler.
//
// Copyright © ????-2004 Athena Dev Teams
@@ -21,16 +20,16 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "fwd.hpp"
+#include "fwd.hpp"
-# include <cstdlib>
+#include <cstdlib>
-# include <chrono>
-# include <functional>
+#include <chrono>
+#include <functional>
-# include "../ints/little.hpp"
+#include "../ints/little.hpp"
-# include "../generic/dumb_ptr.hpp"
+#include "../generic/dumb_ptr.hpp"
namespace tmwa
@@ -141,5 +140,3 @@ public:
bool operator !() { return !td; }
};
} // namespace tmwa
-
-#endif // TMWA_NET_TIMER_T_HPP