From 1cc5fee5904832da6564f12c858423fd5bd1b2b6 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 22 Apr 2014 17:14:28 -0700 Subject: Make travis happy --- src/admin/ladmin.cpp | 5 +- src/admin/ladmin.hpp | 2 +- src/char/char.cpp | 4 +- src/char/inter.hpp | 2 +- src/compat/attr.hpp | 2 +- src/compat/cast.hpp | 2 +- src/compat/fun.hpp | 5 +- src/compat/iter.hpp | 2 +- src/compat/memory.hpp | 2 +- src/compat/nullpo.hpp | 2 +- src/compat/rawmem.hpp | 2 +- src/conf/version.hpp | 2 +- src/generic/db.hpp | 2 +- src/generic/intern-pool.hpp | 2 +- src/generic/matrix.hpp | 2 +- src/generic/md5.hpp | 2 +- src/generic/operators.hpp | 2 +- src/generic/random.hpp | 4 +- src/generic/random.t.hpp | 2 +- src/generic/random2.hpp | 2 +- src/ints/cmp.hpp | 3 + src/ints/udl.hpp | 2 +- src/ints/udl_test.cpp | 584 ++++++++++++++++++------------------- src/ints/wrap.hpp | 10 +- src/io/cxxstdio.hpp | 2 + src/io/fd.hpp | 2 +- src/io/line.hpp | 2 +- src/io/lock.hpp | 2 +- src/io/read.hpp | 2 +- src/io/tty.hpp | 2 +- src/login/login.cpp | 6 +- src/login/login.hpp | 2 +- src/map/chrif.cpp | 2 +- src/map/clif.cpp | 2 +- src/map/clif.t.hpp | 2 +- src/map/grfio.hpp | 2 +- src/map/magic-expr-eval.hpp | 2 +- src/map/magic-expr.hpp | 2 +- src/map/magic-interpreter-aux.hpp | 2 +- src/map/magic-interpreter-base.hpp | 2 +- src/map/magic-interpreter.t.hpp | 2 +- src/map/magic-stmt.hpp | 2 +- src/map/magic-v2.hpp | 2 +- src/map/map.t.hpp | 2 +- src/map/mapflag.hpp | 2 +- src/map/mob.t.hpp | 2 +- src/map/path.hpp | 2 +- src/map/pc.t.hpp | 2 +- src/map/skill-pools.hpp | 2 +- src/map/skill.t.hpp | 2 +- src/map/tmw.hpp | 2 +- src/mmo/config_parse.hpp | 2 +- src/mmo/core.hpp | 2 +- src/mmo/dumb_ptr.hpp | 2 +- src/mmo/human_time_diff.hpp | 2 +- src/mmo/ids.hpp | 20 +- src/mmo/ip.hpp | 2 +- src/mmo/md5more.hpp | 2 +- src/mmo/socket.cpp | 8 +- src/mmo/timer.hpp | 2 +- src/mmo/timer.t.hpp | 2 +- src/poison.hpp | 4 +- src/range/slice.hpp | 3 +- src/sanity.hpp | 4 +- src/strings/all.hpp | 2 +- src/strings/mstring.hpp | 2 +- src/strings/rstring.hpp | 2 +- src/strings/sstring.hpp | 2 +- src/strings/tstring.hpp | 2 +- src/strings/vstring.hpp | 4 +- src/strings/xstring.hpp | 2 +- src/strings/zstring.hpp | 2 +- src/warnings.hpp | 23 +- 73 files changed, 410 insertions(+), 393 deletions(-) (limited to 'src') diff --git a/src/admin/ladmin.cpp b/src/admin/ladmin.cpp index a4c2464..c078104 100644 --- a/src/admin/ladmin.cpp +++ b/src/admin/ladmin.cpp @@ -260,6 +260,7 @@ TString parameters; // needs to be global since it's passed to the parse functio // really should be added to session data static AccountId list_first, list_last; +static int list_type, list_count; // parameter to display a list of accounts static int already_exit_function = 0; // sometimes, the exit function is called twice... so, don't log twice the message @@ -286,7 +287,7 @@ void ladmin_log(XString line) log_with_timestamp(logfp, line); } -static +static __attribute__((noreturn)) void delete_fromlogin(Session *) { { @@ -2770,7 +2771,7 @@ int Connect_login_server(void) Iprintf("Attempt to connect to login-server...\n"_fmt); LADMIN_LOG("Attempt to connect to login-server...\n"_fmt); - login_session = make_connection(login_ip, login_port, SessionParsers{func_parse: parse_fromlogin, func_delete: delete_fromlogin}); + login_session = make_connection(login_ip, login_port, SessionParsers{.func_parse= parse_fromlogin, .func_delete= delete_fromlogin}); if (!login_session) return 0; diff --git a/src/admin/ladmin.hpp b/src/admin/ladmin.hpp index 034f644..06580eb 100644 --- a/src/admin/ladmin.hpp +++ b/src/admin/ladmin.hpp @@ -19,6 +19,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" #endif // TMWA_ADMIN_LADMIN_HPP diff --git a/src/char/char.cpp b/src/char/char.cpp index f714dda..09d4a36 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -2474,7 +2474,7 @@ void parse_char(Session *s) { int len; WFIFOB(s, 2) = 0; - s->set_parsers(SessionParsers{func_parse: parse_frommap, func_delete: delete_frommap}); + s->set_parsers(SessionParsers{.func_parse= parse_frommap, .func_delete= delete_frommap}); server_session[i] = s; if (anti_freeze_enable) server_freezeflag[i] = 5; // Map anti-freeze system. Counter. 5 ok, 4...0 freezed @@ -2612,7 +2612,7 @@ void check_connect_login_server(TimerData *, tick_t) { PRINTF("Attempt to connect to login-server...\n"_fmt); login_session = make_connection(login_ip, login_port, - SessionParsers{func_parse: parse_tologin, func_delete: delete_tologin}); + SessionParsers{.func_parse= parse_tologin, .func_delete= delete_tologin}); if (!login_session) return; realloc_fifo(login_session, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK); diff --git a/src/char/inter.hpp b/src/char/inter.hpp index 7d1a38b..e7a4317 100644 --- a/src/char/inter.hpp +++ b/src/char/inter.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/fwd.hpp" diff --git a/src/compat/attr.hpp b/src/compat/attr.hpp index ea7ba86..531e6b4 100644 --- a/src/compat/attr.hpp +++ b/src/compat/attr.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # ifdef __clang__ diff --git a/src/compat/cast.hpp b/src/compat/cast.hpp index 8db486f..b237df4 100644 --- a/src/compat/cast.hpp +++ b/src/compat/cast.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include # include diff --git a/src/compat/fun.hpp b/src/compat/fun.hpp index 005f2c5..072bda0 100644 --- a/src/compat/fun.hpp +++ b/src/compat/fun.hpp @@ -19,13 +19,10 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include -# include "../sanity.hpp" - - namespace ph = std::placeholders; #endif // TMWA_COMPAT_FUN_HPP diff --git a/src/compat/iter.hpp b/src/compat/iter.hpp index 7793d90..130bdf9 100644 --- a/src/compat/iter.hpp +++ b/src/compat/iter.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/compat/memory.hpp b/src/compat/memory.hpp index 2c0f742..8cafcb4 100644 --- a/src/compat/memory.hpp +++ b/src/compat/memory.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/compat/nullpo.hpp b/src/compat/nullpo.hpp index 75f8110..d6e39a5 100644 --- a/src/compat/nullpo.hpp +++ b/src/compat/nullpo.hpp @@ -41,7 +41,7 @@ # define nullpo_ret(t) nullpo_retr(0, t) # define nullpo_retv(t) nullpo_retr(, t) -# include "../sanity.hpp" +# include "fwd.hpp" /// Used by macros in this header bool nullpo_chk(const char *file, int line, const char *func, diff --git a/src/compat/rawmem.hpp b/src/compat/rawmem.hpp index bbe917c..f030963 100644 --- a/src/compat/rawmem.hpp +++ b/src/compat/rawmem.hpp @@ -23,7 +23,7 @@ # include # include -# include "../sanity.hpp" +# include "fwd.hpp" inline void really_memcpy(uint8_t *dest, const uint8_t *src, size_t n) diff --git a/src/conf/version.hpp b/src/conf/version.hpp index ea394e6..56c12e0 100644 --- a/src/conf/version.hpp +++ b/src/conf/version.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +// just mention "fwd.hpp" to make formatter happy # include "conf-raw/str-VERSION_FULL.h" # include "conf-raw/str-VERSION_HASH.h" diff --git a/src/generic/db.hpp b/src/generic/db.hpp index 314c449..0eac890 100644 --- a/src/generic/db.hpp +++ b/src/generic/db.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include # include diff --git a/src/generic/intern-pool.hpp b/src/generic/intern-pool.hpp index 0ffddd2..b9fc38c 100644 --- a/src/generic/intern-pool.hpp +++ b/src/generic/intern-pool.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/generic/matrix.hpp b/src/generic/matrix.hpp index 40ff9a8..fb18a4c 100644 --- a/src/generic/matrix.hpp +++ b/src/generic/matrix.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/generic/md5.hpp b/src/generic/md5.hpp index 8b1c6ad..071c08b 100644 --- a/src/generic/md5.hpp +++ b/src/generic/md5.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/generic/operators.hpp b/src/generic/operators.hpp index 2a71c46..ca9311a 100644 --- a/src/generic/operators.hpp +++ b/src/generic/operators.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" namespace _operators { diff --git a/src/generic/random.hpp b/src/generic/random.hpp index 45b5371..2fb2632 100644 --- a/src/generic/random.hpp +++ b/src/generic/random.hpp @@ -19,11 +19,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "random.t.hpp" -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/generic/random.t.hpp b/src/generic/random.t.hpp index d26bf56..b20cb64 100644 --- a/src/generic/random.t.hpp +++ b/src/generic/random.t.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" namespace random_ { diff --git a/src/generic/random2.hpp b/src/generic/random2.hpp index 40fcbcf..47e4222 100644 --- a/src/generic/random2.hpp +++ b/src/generic/random2.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "random.hpp" diff --git a/src/ints/cmp.hpp b/src/ints/cmp.hpp index e0e819b..de6a5f2 100644 --- a/src/ints/cmp.hpp +++ b/src/ints/cmp.hpp @@ -25,6 +25,8 @@ namespace ints { +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wtype-limits" template T saturate(const U& v) { @@ -58,6 +60,7 @@ namespace ints return v; } } +# pragma GCC diagnostic pop } // namespace ints using ints::saturate; diff --git a/src/ints/udl.hpp b/src/ints/udl.hpp index ecb5478..caed16b 100644 --- a/src/ints/udl.hpp +++ b/src/ints/udl.hpp @@ -122,7 +122,7 @@ namespace ints template constexpr - operator T() + operator T() const { typedef typename std::make_unsigned::type U; // boo, body of constexpr function can't use variables diff --git a/src/ints/udl_test.cpp b/src/ints/udl_test.cpp index 3bcbaad..acb4f76 100644 --- a/src/ints/udl_test.cpp +++ b/src/ints/udl_test.cpp @@ -30,439 +30,439 @@ TEST(ints, smc) { { ints::SignedMagnitudeConstant i; - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); - static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + (void)static_cast(i); } { ints::SignedMagnitudeConstant i; - //static_cast(i); - //static_cast(i); - //static_cast(i); - //static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); + //(void)static_cast(i); } { //ints::SignedMagnitudeConstant i; diff --git a/src/ints/wrap.hpp b/src/ints/wrap.hpp index b25a1ad..71f2673 100644 --- a/src/ints/wrap.hpp +++ b/src/ints/wrap.hpp @@ -45,17 +45,17 @@ namespace ints bool operator !() const { return !_value; } }; - template + template bool operator == (W l, W r) { return l._value == r._value; } - template + template bool operator != (W l, W r) { return l._value != r._value; } - template + template bool operator < (W l, W r) { return l._value < r._value; @@ -74,8 +74,8 @@ namespace ints struct Sub : T { constexpr - Sub(typename T::wrapped_type v) - : T(v) + Sub(typename T::wrapped_type v2) + : T(v2) {} }; return Sub(v); diff --git a/src/io/cxxstdio.hpp b/src/io/cxxstdio.hpp index 479707a..65d32cd 100644 --- a/src/io/cxxstdio.hpp +++ b/src/io/cxxstdio.hpp @@ -101,7 +101,9 @@ namespace cxxstdio return v; } + inline const char *convert_for_printf(const char *) = delete; + inline char *convert_for_scanf(char *) = delete; # if 0 diff --git a/src/io/fd.hpp b/src/io/fd.hpp index 7afb40f..cf91ed1 100644 --- a/src/io/fd.hpp +++ b/src/io/fd.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include # include diff --git a/src/io/line.hpp b/src/io/line.hpp index bb002b8..fb1984d 100644 --- a/src/io/line.hpp +++ b/src/io/line.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/rstring.hpp" # include "../strings/astring.hpp" diff --git a/src/io/lock.hpp b/src/io/lock.hpp index b879da5..ec8a82e 100644 --- a/src/io/lock.hpp +++ b/src/io/lock.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "write.hpp" diff --git a/src/io/read.hpp b/src/io/read.hpp index f99fb56..3816294 100644 --- a/src/io/read.hpp +++ b/src/io/read.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/fwd.hpp" diff --git a/src/io/tty.hpp b/src/io/tty.hpp index 97487b8..b6eb227 100644 --- a/src/io/tty.hpp +++ b/src/io/tty.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # define SGR_BLACK "\e[30m" diff --git a/src/login/login.cpp b/src/login/login.cpp index e7de1ae..6831b19 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -2995,7 +2995,7 @@ void parse_login(Session *s) WFIFOW(s, 0) = 0x2711; WFIFOB(s, 2) = 0; WFIFOSET(s, 3); - s->set_parsers(SessionParsers{func_parse: parse_fromchar, func_delete: delete_fromchar}); + s->set_parsers(SessionParsers{.func_parse= parse_fromchar, .func_delete= delete_fromchar}); realloc_fifo(s, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK); // send GM account to char-server len = 4; @@ -3069,7 +3069,7 @@ void parse_login(Session *s) password, ip); PRINTF("Connection of a remote administration accepted (non encrypted password).\n"_fmt); WFIFOB(s, 2) = 0; - s->set_parsers(SessionParsers{func_parse: parse_admin, func_delete: delete_admin}); + s->set_parsers(SessionParsers{.func_parse= parse_admin, .func_delete= delete_admin}); } else if (admin_state != 1) LOGIN_LOG("'ladmin'-login: Connection in administration mode REFUSED - remote administration is disabled (non encrypted password: %s, ip: %s)\n"_fmt, @@ -3872,7 +3872,7 @@ int do_init(Slice argv) read_gm_account(); mmo_auth_init(); // set_termfunc (mmo_auth_sync); - login_session = make_listen_port(login_port, SessionParsers{func_parse: parse_login, func_delete: delete_login}); + login_session = make_listen_port(login_port, SessionParsers{.func_parse= parse_login, .func_delete= delete_login}); Timer(gettick() + std::chrono::minutes(5), diff --git a/src/login/login.hpp b/src/login/login.hpp index 3458dab..9c17c55 100644 --- a/src/login/login.hpp +++ b/src/login/login.hpp @@ -19,6 +19,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" #endif // TMWA_LOGIN_LOGIN_HPP diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 88fb039..3c2ac63 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -1210,7 +1210,7 @@ void check_connect_char_server(TimerData *, tick_t) PRINTF("Attempt to connect to char-server...\n"_fmt); chrif_state = 0; char_session = make_connection(char_ip, char_port, - SessionParsers{func_parse: chrif_parse, func_delete: chrif_delete}); + SessionParsers{.func_parse= chrif_parse, .func_delete= chrif_delete}); if (!char_session) return; realloc_fifo(char_session, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK); diff --git a/src/map/clif.cpp b/src/map/clif.cpp index be544db..bdb8609 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -5482,5 +5482,5 @@ void clif_parse(Session *s) void do_init_clif(void) { - make_listen_port(map_port, SessionParsers{func_parse: clif_parse, func_delete: clif_delete}); + make_listen_port(map_port, SessionParsers{.func_parse= clif_parse, .func_delete= clif_delete}); } diff --git a/src/map/clif.t.hpp b/src/map/clif.t.hpp index 5cb06ad..2da6cde 100644 --- a/src/map/clif.t.hpp +++ b/src/map/clif.t.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/map/grfio.hpp b/src/map/grfio.hpp index 9b6d5e2..3083f8c 100644 --- a/src/map/grfio.hpp +++ b/src/map/grfio.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/map/magic-expr-eval.hpp b/src/map/magic-expr-eval.hpp index 9b9f5f8..e19c896 100644 --- a/src/map/magic-expr-eval.hpp +++ b/src/map/magic-expr-eval.hpp @@ -20,7 +20,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../range/slice.hpp" diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp index 4d78bab..bbe8bbf 100644 --- a/src/map/magic-expr.hpp +++ b/src/map/magic-expr.hpp @@ -20,7 +20,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "magic-interpreter.hpp" diff --git a/src/map/magic-interpreter-aux.hpp b/src/map/magic-interpreter-aux.hpp index 1369b38..0b78b58 100644 --- a/src/map/magic-interpreter-aux.hpp +++ b/src/map/magic-interpreter-aux.hpp @@ -20,7 +20,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "magic-interpreter.t.hpp" diff --git a/src/map/magic-interpreter-base.hpp b/src/map/magic-interpreter-base.hpp index 9b1e08a..780ada4 100644 --- a/src/map/magic-interpreter-base.hpp +++ b/src/map/magic-interpreter-base.hpp @@ -19,6 +19,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" #endif // TMWA_MAP_MAGIC_INTERPRETER_BASE_HPP diff --git a/src/map/magic-interpreter.t.hpp b/src/map/magic-interpreter.t.hpp index 9310a7b..1fe5fa3 100644 --- a/src/map/magic-interpreter.t.hpp +++ b/src/map/magic-interpreter.t.hpp @@ -20,7 +20,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../generic/enum.hpp" diff --git a/src/map/magic-stmt.hpp b/src/map/magic-stmt.hpp index 838854f..0e687a6 100644 --- a/src/map/magic-stmt.hpp +++ b/src/map/magic-stmt.hpp @@ -19,6 +19,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" #endif // TMWA_MAP_MAGIC_STMT_HPP diff --git a/src/map/magic-v2.hpp b/src/map/magic-v2.hpp index 888e183..92b6f4e 100644 --- a/src/map/magic-v2.hpp +++ b/src/map/magic-v2.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/zstring.hpp" diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp index d9e3c1f..d90bdab 100644 --- a/src/map/map.t.hpp +++ b/src/map/map.t.hpp @@ -586,7 +586,7 @@ struct NpcName : VString<23> {}; struct ScriptLabel : VString<23> {}; struct ItemName : VString<23> {}; -class BlockId : public Wrapped { public: BlockId() : Wrapped() {} protected: template constexpr explicit BlockId(A... a) : Wrapped(a...) {} }; +class BlockId : public Wrapped { public: BlockId() : Wrapped() {} protected: constexpr explicit BlockId(uint32_t a) : Wrapped(a) {} }; inline BlockId account_to_block(AccountId a) { return wrap(unwrap(a)); } inline diff --git a/src/map/mapflag.hpp b/src/map/mapflag.hpp index e3a55f5..c8eec1d 100644 --- a/src/map/mapflag.hpp +++ b/src/map/mapflag.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../mmo/extract.hpp" // TODO remove this (requires specializing the *other* half) diff --git a/src/map/mob.t.hpp b/src/map/mob.t.hpp index 37fd13e..5e056d5 100644 --- a/src/map/mob.t.hpp +++ b/src/map/mob.t.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/map/path.hpp b/src/map/path.hpp index 47b9814..9bdb520 100644 --- a/src/map/path.hpp +++ b/src/map/path.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "map.hpp" diff --git a/src/map/pc.t.hpp b/src/map/pc.t.hpp index 65e1046..e022f3b 100644 --- a/src/map/pc.t.hpp +++ b/src/map/pc.t.hpp @@ -22,7 +22,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/map/skill-pools.hpp b/src/map/skill-pools.hpp index 6781907..28351b1 100644 --- a/src/map/skill-pools.hpp +++ b/src/map/skill-pools.hpp @@ -19,6 +19,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" #endif // TMWA_MAP_SKILL_POOLS_HPP diff --git a/src/map/skill.t.hpp b/src/map/skill.t.hpp index 4e30cba..b2ef2de 100644 --- a/src/map/skill.t.hpp +++ b/src/map/skill.t.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/map/tmw.hpp b/src/map/tmw.hpp index 670599e..9b11d64 100644 --- a/src/map/tmw.hpp +++ b/src/map/tmw.hpp @@ -20,7 +20,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/fwd.hpp" diff --git a/src/mmo/config_parse.hpp b/src/mmo/config_parse.hpp index dd1b79e..080f13c 100644 --- a/src/mmo/config_parse.hpp +++ b/src/mmo/config_parse.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/fwd.hpp" diff --git a/src/mmo/core.hpp b/src/mmo/core.hpp index 5699045..99e41c8 100644 --- a/src/mmo/core.hpp +++ b/src/mmo/core.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../range/slice.hpp" diff --git a/src/mmo/dumb_ptr.hpp b/src/mmo/dumb_ptr.hpp index 9632945..aa17ecd 100644 --- a/src/mmo/dumb_ptr.hpp +++ b/src/mmo/dumb_ptr.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/mmo/human_time_diff.hpp b/src/mmo/human_time_diff.hpp index aace438..5552e2b 100644 --- a/src/mmo/human_time_diff.hpp +++ b/src/mmo/human_time_diff.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/xstring.hpp" diff --git a/src/mmo/ids.hpp b/src/mmo/ids.hpp index 71164ff..3c5b1ba 100644 --- a/src/mmo/ids.hpp +++ b/src/mmo/ids.hpp @@ -25,13 +25,13 @@ # include "extract.hpp" -class Species : public Wrapped { public: explicit operator bool() const = delete; bool operator !() const = delete; Species() : Wrapped() {} protected: template constexpr explicit Species(A... a) : Wrapped(a...) {} }; +class Species : public Wrapped { public: explicit operator bool() const = delete; bool operator !() const = delete; Species() : Wrapped() {} protected: constexpr explicit Species(uint16_t a) : Wrapped(a) {} }; -class AccountId : public Wrapped { public: AccountId() : Wrapped() {} protected: template constexpr explicit AccountId(A... a) : Wrapped(a...) {} }; -class CharId : public Wrapped { public: CharId() : Wrapped() {} protected: template constexpr explicit CharId(A... a) : Wrapped(a...) {} }; +class AccountId : public Wrapped { public: AccountId() : Wrapped() {} protected: constexpr explicit AccountId(uint32_t a) : Wrapped(a) {} }; +class CharId : public Wrapped { public: CharId() : Wrapped() {} protected: constexpr explicit CharId(uint32_t a) : Wrapped(a) {} }; // important note: slave mobs synthesize PartyId as -BlockId of master -class PartyId : public Wrapped { public: PartyId() : Wrapped() {} protected: template constexpr explicit PartyId(A... a) : Wrapped(a...) {} }; -class ItemNameId : public Wrapped { public: ItemNameId() : Wrapped() {} protected: template constexpr explicit ItemNameId(A... a) : Wrapped(a...) {} }; +class PartyId : public Wrapped { public: PartyId() : Wrapped() {} protected: constexpr explicit PartyId(uint32_t a) : Wrapped(a) {} }; +class ItemNameId : public Wrapped { public: ItemNameId() : Wrapped() {} protected: constexpr explicit ItemNameId(uint16_t a) : Wrapped(a) {} }; class GmLevel { @@ -41,7 +41,7 @@ class GmLevel constexpr explicit GmLevel(uint32_t b) : bits(b) {} constexpr explicit - operator uint32_t() { return bits; } + operator uint32_t() const { return bits; } template explicit @@ -65,16 +65,16 @@ public: // the argument is the level of a command constexpr - bool satisfies(GmLevel perm) { return bits >= perm.bits; } + bool satisfies(GmLevel perm) const { return bits >= perm.bits; } // the argument is another player's gm level, for info commands constexpr - bool detects(GmLevel other) { return bits >= other.bits; } + bool detects(GmLevel other) const { return bits >= other.bits; } // the argument is another player's gm level, for aggressive commands constexpr - bool overwhelms(GmLevel other) { return bits >= other.bits; } + bool overwhelms(GmLevel other) const { return bits >= other.bits; } // the argument is another potential permission level constexpr - bool obsoletes(GmLevel plvl) { return bits >= plvl.bits; } + bool obsoletes(GmLevel plvl) const { return bits >= plvl.bits; } constexpr uint16_t get_public_word() const diff --git a/src/mmo/ip.hpp b/src/mmo/ip.hpp index a425710..c765308 100644 --- a/src/mmo/ip.hpp +++ b/src/mmo/ip.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/mmo/md5more.hpp b/src/mmo/md5more.hpp index b1da783..6884bee 100644 --- a/src/mmo/md5more.hpp +++ b/src/mmo/md5more.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../generic/md5.hpp" diff --git a/src/mmo/socket.cpp b/src/mmo/socket.cpp index 79857b1..8714062 100644 --- a/src/mmo/socket.cpp +++ b/src/mmo/socket.cpp @@ -228,7 +228,7 @@ void connect_client(Session *ls) fd.fcntl(F_SETFL, O_NONBLOCK); set_session(fd, make_unique( - SessionIO{func_recv: recv_to_fifo, func_send: send_from_fifo}, + SessionIO{.func_recv= recv_to_fifo, .func_send= send_from_fifo}, ls->for_inferior)); Session *s = get_session(fd); s->fd = fd; @@ -291,8 +291,8 @@ Session *make_listen_port(uint16_t port, SessionParsers inferior) readfds.set(fd); set_session(fd, make_unique( - SessionIO{func_recv: connect_client, func_send: nullptr}, - SessionParsers{func_parse: nullptr, func_delete: nothing_delete})); + SessionIO{.func_recv= connect_client, .func_send= nullptr}, + SessionParsers{.func_parse= nullptr, .func_delete= nothing_delete})); Session *s = get_session(fd); s->for_inferior = inferior; s->fd = fd; @@ -346,7 +346,7 @@ Session *make_connection(IP4Address ip, uint16_t port, SessionParsers parsers) readfds.set(fd); set_session(fd, make_unique( - SessionIO{func_recv: recv_to_fifo, func_send: send_from_fifo}, + SessionIO{.func_recv= recv_to_fifo, .func_send= send_from_fifo}, parsers)); Session *s = get_session(fd); s->fd = fd; diff --git a/src/mmo/timer.hpp b/src/mmo/timer.hpp index 363cf17..ddb559f 100644 --- a/src/mmo/timer.hpp +++ b/src/mmo/timer.hpp @@ -23,7 +23,7 @@ # include "timer.t.hpp" -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/fwd.hpp" diff --git a/src/mmo/timer.t.hpp b/src/mmo/timer.t.hpp index 6066e7c..a1d05ef 100644 --- a/src/mmo/timer.t.hpp +++ b/src/mmo/timer.t.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include # include diff --git a/src/poison.hpp b/src/poison.hpp index 0328825..53694c4 100644 --- a/src/poison.hpp +++ b/src/poison.hpp @@ -18,9 +18,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# if 0 -# include "../sanity.hpp" -# endif +// just mention "fwd.hpp" to make formatter happy // impossible(*) to use safely // removed in C11 diff --git a/src/range/slice.hpp b/src/range/slice.hpp index f645595..ce35acf 100644 --- a/src/range/slice.hpp +++ b/src/range/slice.hpp @@ -19,12 +19,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include # include - # include template diff --git a/src/sanity.hpp b/src/sanity.hpp index 70ee8fe..88bb24b 100644 --- a/src/sanity.hpp +++ b/src/sanity.hpp @@ -19,9 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# if 0 -# include "../sanity.hpp" -# endif +// just mention "fwd.hpp" to make formatter happy # ifndef __cplusplus # error "Please compile in C++ mode" diff --git a/src/strings/all.hpp b/src/strings/all.hpp index 26079ed..c87a403 100644 --- a/src/strings/all.hpp +++ b/src/strings/all.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "base.hpp" # include "mstring.hpp" diff --git a/src/strings/mstring.hpp b/src/strings/mstring.hpp index 8225d9e..2da6a78 100644 --- a/src/strings/mstring.hpp +++ b/src/strings/mstring.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/strings/rstring.hpp b/src/strings/rstring.hpp index 1de4db0..1de3e87 100644 --- a/src/strings/rstring.hpp +++ b/src/strings/rstring.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include # include diff --git a/src/strings/sstring.hpp b/src/strings/sstring.hpp index 0594499..60fa4f3 100644 --- a/src/strings/sstring.hpp +++ b/src/strings/sstring.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "base.hpp" # include "rstring.hpp" diff --git a/src/strings/tstring.hpp b/src/strings/tstring.hpp index 38f41cd..748af9e 100644 --- a/src/strings/tstring.hpp +++ b/src/strings/tstring.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "base.hpp" # include "rstring.hpp" diff --git a/src/strings/vstring.hpp b/src/strings/vstring.hpp index 33dfb10..022347a 100644 --- a/src/strings/vstring.hpp +++ b/src/strings/vstring.hpp @@ -19,7 +19,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" + +# include # include "base.hpp" diff --git a/src/strings/xstring.hpp b/src/strings/xstring.hpp index ad7c40d..96929c7 100644 --- a/src/strings/xstring.hpp +++ b/src/strings/xstring.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "base.hpp" # include "literal.hpp" diff --git a/src/strings/zstring.hpp b/src/strings/zstring.hpp index c75c7c9..3b651b9 100644 --- a/src/strings/zstring.hpp +++ b/src/strings/zstring.hpp @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include diff --git a/src/warnings.hpp b/src/warnings.hpp index 1ea0074..0b2358a 100644 --- a/src/warnings.hpp +++ b/src/warnings.hpp @@ -21,9 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#if 0 -# include "../sanity.hpp" -#endif +// just mention "fwd.hpp" to make formatter happy // This file is currently targeted at: // GCC 4.6 (incomplete due to bugs) @@ -221,6 +219,18 @@ E("-Wbuiltin-macro-redefined") //W("-Wc++11-compat") I("-Wc++0x-compat") +// I care about whether my code compiles with the standard as implemented +// by certain compilers, not whether it matches with an *exact* standard. +#ifdef __clang__ +# if __has_warning("-Wc++1y-extensions") +IC("-Wc++1y-extensions") +# else +static_assert('E', "-Wc++1y-extensions not in this clang version"); +# endif +#else +static_assert('E', "-Wc++1y-extensions not in GCC"); +#endif + /// Warn about pointer casts which increase alignment X("-Wcast-align") @@ -355,6 +365,10 @@ EG47("-Wfree-nonheap-object") // -Wgnu is a clang alias for -Wpedantic +// Foo{x: y} +EC("-Wgnu-designator") + + /// Warn whenever type qualifiers are ignored. E("-Wignored-qualifiers") @@ -404,6 +418,9 @@ E("-Wmain") /// Warn about maybe uninitialized automatic variables EG47("-Wmaybe-uninitialized") +// bitch about 'struct Foo' vs 'class Foo' +IC("-Wmismatched-tags") + /// Warn about possibly missing braces around /// initializers // beware of things like std::array! -- cgit v1.2.3-60-g2f50