summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/const_array.hpp22
-rw-r--r--src/common/core.hpp4
-rw-r--r--src/common/dumb_ptr.hpp18
-rw-r--r--src/common/extract.hpp12
-rw-r--r--src/common/human_time_diff.hpp6
-rw-r--r--src/common/intern-pool.hpp12
-rw-r--r--src/common/ip.hpp8
-rw-r--r--src/common/md5calc.cpp2
-rw-r--r--src/common/md5calc.hpp22
-rw-r--r--src/common/mmo.hpp10
-rw-r--r--src/common/nullpo.hpp2
-rw-r--r--src/common/socket.cpp4
-rw-r--r--src/common/utils.hpp26
-rw-r--r--src/common/utils2.hpp98
14 files changed, 123 insertions, 123 deletions
diff --git a/src/common/const_array.hpp b/src/common/const_array.hpp
index 383a4e2..fe15728 100644
--- a/src/common/const_array.hpp
+++ b/src/common/const_array.hpp
@@ -19,19 +19,19 @@
// 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"
-#include <cstring>
+# include <cstring>
-#include <iterator>
-#include <ostream>
-#include <vector>
+# include <iterator>
+# include <ostream>
+# include <vector>
-#ifdef WORKAROUND_GCC46_COMPILER
+# ifdef WORKAROUND_GCC46_COMPILER
// constexpr is buggy with templates in this version
// Is this still needed now that const_string is removed?
-# define constexpr /* nothing */
-#endif
+# define constexpr /* nothing */
+# endif
// TODO see if I ever actually use this, and not the subclass
template<class T>
@@ -125,8 +125,8 @@ public:
}
};
-#ifdef WORKAROUND_GCC46_COMPILER
-# undef constexpr
-#endif
+# ifdef WORKAROUND_GCC46_COMPILER
+# undef constexpr
+# endif
#endif // CONST_ARRAY_HPP
diff --git a/src/common/core.hpp b/src/common/core.hpp
index 11b04fd..f93f5a1 100644
--- a/src/common/core.hpp
+++ b/src/common/core.hpp
@@ -1,9 +1,9 @@
#ifndef CORE_HPP
#define CORE_HPP
-#include "../sanity.hpp"
+# include "../sanity.hpp"
-#include "../strings/fwd.hpp"
+# include "../strings/fwd.hpp"
/// core.c contains a server-independent main() function
/// and then runs a do_sendrecv loop
diff --git a/src/common/dumb_ptr.hpp b/src/common/dumb_ptr.hpp
index 1dba39d..1ac237a 100644
--- a/src/common/dumb_ptr.hpp
+++ b/src/common/dumb_ptr.hpp
@@ -19,17 +19,17 @@
// 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"
-#include <cstring>
+# include <cstring>
-#include <algorithm>
+# include <algorithm>
-#include "../strings/fstring.hpp"
-#include "../strings/zstring.hpp"
-#include "../strings/xstring.hpp"
+# include "../strings/fstring.hpp"
+# include "../strings/zstring.hpp"
+# include "../strings/xstring.hpp"
-#include "const_array.hpp"
+# include "const_array.hpp"
// unmanaged new/delete-able pointer
// should be replaced by std::unique_ptr<T>
@@ -210,9 +210,9 @@ struct dumb_string
return dumb_string::copy(&*s.begin(), &*s.end());
}
static
-#ifndef __clang__
+# ifndef __clang__
__attribute__((warning("shouldn't use this - slice instead")))
-#endif
+# endif
dumb_string copyn(const char *sn, size_t n)
{
return dumb_string::copy(sn, sn + strnlen(sn, n));
diff --git a/src/common/extract.hpp b/src/common/extract.hpp
index 4f90be4..e798204 100644
--- a/src/common/extract.hpp
+++ b/src/common/extract.hpp
@@ -19,15 +19,15 @@
// 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"
-#include <algorithm>
+# include <algorithm>
-#include "../strings/xstring.hpp"
+# include "../strings/xstring.hpp"
-#include "const_array.hpp"
-#include "mmo.hpp"
-#include "utils.hpp"
+# include "const_array.hpp"
+# include "mmo.hpp"
+# include "utils.hpp"
template<class T, typename=typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, char>::value && !std::is_same<T, bool>::value>::type>
bool extract(XString str, T *iv)
diff --git a/src/common/human_time_diff.hpp b/src/common/human_time_diff.hpp
index b8754b2..b8040b8 100644
--- a/src/common/human_time_diff.hpp
+++ b/src/common/human_time_diff.hpp
@@ -19,11 +19,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 "../sanity.hpp"
+# include "../sanity.hpp"
-#include "../strings/xstring.hpp"
+# include "../strings/xstring.hpp"
-#include "extract.hpp"
+# include "extract.hpp"
struct HumanTimeDiff
{
diff --git a/src/common/intern-pool.hpp b/src/common/intern-pool.hpp
index 204b659..163e5cc 100644
--- a/src/common/intern-pool.hpp
+++ b/src/common/intern-pool.hpp
@@ -1,14 +1,14 @@
#ifndef INTERN_POOL_HPP
#define INTERN_POOL_HPP
-#include <cassert>
+# include <cassert>
-#include <map>
-#include <vector>
+# include <map>
+# include <vector>
-#include "../strings/fstring.hpp"
-#include "../strings/zstring.hpp"
-#include "../strings/xstring.hpp"
+# include "../strings/fstring.hpp"
+# include "../strings/zstring.hpp"
+# include "../strings/xstring.hpp"
class InternPool
{
diff --git a/src/common/ip.hpp b/src/common/ip.hpp
index 7e645bb..d6e6f04 100644
--- a/src/common/ip.hpp
+++ b/src/common/ip.hpp
@@ -19,13 +19,13 @@
// 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"
-#include <netinet/in.h>
+# include <netinet/in.h>
-#include "../strings/fwd.hpp"
+# include "../strings/fwd.hpp"
-#include "extract.hpp"
+# include "extract.hpp"
// TODO - in the long run ports belong here also
// and of course, IPv6 stuff.
diff --git a/src/common/md5calc.cpp b/src/common/md5calc.cpp
index 8d650fa..d23f8e3 100644
--- a/src/common/md5calc.cpp
+++ b/src/common/md5calc.cpp
@@ -16,7 +16,7 @@
// auxilary data
/*
sin() constant table
-# Reformatted output of:
+#Reformatted output of:
echo 'scale=40; obase=16; for (i=1;i<=64;i++) print 2^32 * sin(i), "\n"' |
bc | sed 's/^-//;s/^/0x/;s/\..*$/,/'
*/
diff --git a/src/common/md5calc.hpp b/src/common/md5calc.hpp
index 479c1a9..45bec84 100644
--- a/src/common/md5calc.hpp
+++ b/src/common/md5calc.hpp
@@ -1,23 +1,23 @@
#ifndef MD5CALC_HPP
#define MD5CALC_HPP
-#include "../sanity.hpp"
+# include "../sanity.hpp"
-#include <netinet/in.h>
+# include <netinet/in.h>
-#include <cstdint>
-#include <cstddef>
-#include <cstdio>
+# include <cstdint>
+# include <cstddef>
+# include <cstdio>
-#include <array>
+# include <array>
-#include "../strings/fwd.hpp"
-#include "../strings/vstring.hpp"
+# include "../strings/fwd.hpp"
+# include "../strings/vstring.hpp"
-#include "../io/fwd.hpp"
+# include "../io/fwd.hpp"
-#include "ip.hpp"
-#include "mmo.hpp"
+# include "ip.hpp"
+# include "mmo.hpp"
/// The digest state - becomes the output
struct MD5_state
diff --git a/src/common/mmo.hpp b/src/common/mmo.hpp
index 0f89c81..178bb08 100644
--- a/src/common/mmo.hpp
+++ b/src/common/mmo.hpp
@@ -57,7 +57,7 @@ T stringish(VString<sizeof(T) - 1> iv)
static_cast<VString<sizeof(T) - 1>&>(rv) = iv;
return rv;
}
-#define DEFAULT_EMAIL stringish<AccountEmail>("a@a.com")
+# define DEFAULT_EMAIL stringish<AccountEmail>("a@a.com")
// It is decreed: a mapname shall not contain an extension
class MapName : public strings::_crtp_string<MapName, MapName, strings::ZPair>
@@ -111,12 +111,12 @@ public:
}
VString<23> to__canonical() const
{
-#if NAME_IGNORING_CASE == 0
+# if NAME_IGNORING_CASE == 0
return to__actual();
-#endif
-#if NAME_IGNORING_CASE == 1
+# endif
+# if NAME_IGNORING_CASE == 1
return to__lower();
-#endif
+# endif
}
friend bool operator == (const CharName& l, const CharName& r)
diff --git a/src/common/nullpo.hpp b/src/common/nullpo.hpp
index 26aab20..0eaa1b2 100644
--- a/src/common/nullpo.hpp
+++ b/src/common/nullpo.hpp
@@ -11,7 +11,7 @@
/// nullpo_retr(rv, cond) - return given value instead
# ifndef BUG_FREE
-# define nullpo_retr(ret, t) \
+# define nullpo_retr(ret, t) \
if (nullpo_chk(__FILE__, __LINE__, __PRETTY_FUNCTION__, t)) \
return ret;
# else // BUG_FREE
diff --git a/src/common/socket.cpp b/src/common/socket.cpp
index b507cd8..61552c7 100644
--- a/src/common/socket.cpp
+++ b/src/common/socket.cpp
@@ -208,7 +208,7 @@ int make_listen_port(uint16_t port)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#if __GNUC__ > 4 || __GNUC_MINOR__ >= 8
-#pragma GCC diagnostic ignored "-Wuseless-cast"
+# pragma GCC diagnostic ignored "-Wuseless-cast"
#endif
server_address.sin_addr.s_addr = htonl(INADDR_ANY);
server_address.sin_port = htons(port);
@@ -268,7 +268,7 @@ int make_connection(IP4Address ip, uint16_t port)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#if __GNUC__ > 4 || __GNUC_MINOR__ >= 8
-#pragma GCC diagnostic ignored "-Wuseless-cast"
+# pragma GCC diagnostic ignored "-Wuseless-cast"
#endif
server_address.sin_port = htons(port);
#pragma GCC diagnostic pop
diff --git a/src/common/utils.hpp b/src/common/utils.hpp
index 2d2e2d5..f975e34 100644
--- a/src/common/utils.hpp
+++ b/src/common/utils.hpp
@@ -1,21 +1,21 @@
#ifndef UTILS_HPP
#define UTILS_HPP
-#include "../sanity.hpp"
+# include "../sanity.hpp"
-#include <cstdio>
-#include <cstring>
+# include <cstdio>
+# include <cstring>
-#include <type_traits>
+# include <type_traits>
-#include "../strings/fwd.hpp"
-#include "../strings/vstring.hpp"
+# include "../strings/fwd.hpp"
+# include "../strings/vstring.hpp"
-#include "../io/fwd.hpp"
+# include "../io/fwd.hpp"
-#include "const_array.hpp"
-#include "operators.hpp"
-#include "utils2.hpp"
+# include "const_array.hpp"
+# include "operators.hpp"
+# include "utils2.hpp"
template<class T>
struct is_trivially_copyable
@@ -122,16 +122,16 @@ void stamp_time(timestamp_milliseconds_buffer&);
void log_with_timestamp(io::WriteFile& out, XString line);
// TODO VString?
-#define TIMESTAMP_DUMMY "YYYY-MM-DD HH:MM:SS"
+# define TIMESTAMP_DUMMY "YYYY-MM-DD HH:MM:SS"
static_assert(sizeof(TIMESTAMP_DUMMY) == sizeof(timestamp_seconds_buffer),
"timestamp size");
-#define WITH_TIMESTAMP(str) str TIMESTAMP_DUMMY
+# define WITH_TIMESTAMP(str) str TIMESTAMP_DUMMY
// str: prefix: YYYY-MM-DD HH:MM:SS
// sizeof: 01234567890123456789012345678
// str + sizeof: ^
// -1: ^
// there's probably a better way to do this now
-#define REPLACE_TIMESTAMP(str, t) \
+# define REPLACE_TIMESTAMP(str, t) \
stamp_time( \
reinterpret_cast<timestamp_seconds_buffer *>( \
str + sizeof(str) \
diff --git a/src/common/utils2.hpp b/src/common/utils2.hpp
index 7dbd741..0f72aff 100644
--- a/src/common/utils2.hpp
+++ b/src/common/utils2.hpp
@@ -1,19 +1,19 @@
#ifndef UTILS2_HPP
#define UTILS2_HPP
-#include "../sanity.hpp"
+# include "../sanity.hpp"
-#include <algorithm>
-#include <functional>
-#include <iterator>
-#include <memory>
-#include <type_traits>
+# include <algorithm>
+# include <functional>
+# include <iterator>
+# include <memory>
+# include <type_traits>
-#ifdef __clang__
-# define FALLTHROUGH [[clang::fallthrough]]
-#else
-# define FALLTHROUGH /* fallthrough */
-#endif
+# ifdef __clang__
+# define FALLTHROUGH [[clang::fallthrough]]
+# else
+# define FALLTHROUGH /* fallthrough */
+# endif
template<class T, class E, E max>
struct earray
@@ -136,44 +136,44 @@ struct remove_enum<E, true>
};
-#define ENUM_BITWISE_OPERATORS(E) \
-inline \
-E operator & (E l, E r) \
-{ \
- typedef underlying_type<E>::type U; \
- return E(U(l) & U(r)); \
-} \
-inline \
-E operator | (E l, E r) \
-{ \
- typedef underlying_type<E>::type U; \
- return E(U(l) | U(r)); \
-} \
-inline \
-E operator ^ (E l, E r) \
-{ \
- typedef underlying_type<E>::type U; \
- return E(U(l) ^ U(r)); \
-} \
-inline \
-E& operator &= (E& l, E r) \
-{ \
- return l = l & r; \
-} \
-inline \
-E& operator |= (E& l, E r) \
-{ \
- return l = l | r; \
-} \
-inline \
-E& operator ^= (E& l, E r) \
-{ \
- return l = l ^ r; \
-} \
-inline \
-E operator ~ (E r) \
-{ \
- return E(-1) ^ r; \
+# define ENUM_BITWISE_OPERATORS(E) \
+inline \
+E operator & (E l, E r) \
+{ \
+ typedef underlying_type<E>::type U; \
+ return E(U(l) & U(r)); \
+} \
+inline \
+E operator | (E l, E r) \
+{ \
+ typedef underlying_type<E>::type U; \
+ return E(U(l) | U(r)); \
+} \
+inline \
+E operator ^ (E l, E r) \
+{ \
+ typedef underlying_type<E>::type U; \
+ return E(U(l) ^ U(r)); \
+} \
+inline \
+E& operator &= (E& l, E r) \
+{ \
+ return l = l & r; \
+} \
+inline \
+E& operator |= (E& l, E r) \
+{ \
+ return l = l | r; \
+} \
+inline \
+E& operator ^= (E& l, E r) \
+{ \
+ return l = l ^ r; \
+} \
+inline \
+E operator ~ (E r) \
+{ \
+ return E(-1) ^ r; \
}
template<class E>