summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2019-01-10 18:30:38 -0500
committergumi <git@gumi.ca>2019-01-11 12:03:47 -0500
commit2f94539545b176a7dc2981b1a932b8428e33eaa7 (patch)
tree2124205fc141ceaf98253f1ab1f515e8eb44889a /src
parentd8145c4f940a664eb403f7acca10f2caf86e5330 (diff)
downloadtmwa-2f94539545b176a7dc2981b1a932b8428e33eaa7.tar.gz
tmwa-2f94539545b176a7dc2981b1a932b8428e33eaa7.tar.bz2
tmwa-2f94539545b176a7dc2981b1a932b8428e33eaa7.tar.xz
tmwa-2f94539545b176a7dc2981b1a932b8428e33eaa7.zip
drop support for gcc-5, gcc-6, clang-4, clang-5 in travis and fix some misc issues
Diffstat (limited to 'src')
-rw-r--r--src/char/char.hpp8
-rw-r--r--src/diagnostics.hpp2
-rw-r--r--src/io/cxxstdio.hpp16
-rw-r--r--src/login/login.cpp6
-rw-r--r--src/map/map.hpp8
-rw-r--r--src/map/script-fun.cpp2
-rw-r--r--src/warnings.hpp2
7 files changed, 23 insertions, 21 deletions
diff --git a/src/char/char.hpp b/src/char/char.hpp
index 1151750..ab74507 100644
--- a/src/char/char.hpp
+++ b/src/char/char.hpp
@@ -71,10 +71,10 @@ void char_log(XString line);
#define CHAR_LOG(fmt, ...) \
char_log(STRPRINTF(fmt, ## __VA_ARGS__))
-#define CHAR_LOG_AND_ECHO(...) \
- do { \
- PRINTF(__VA_ARGS__); \
- CHAR_LOG(__VA_ARGS__); \
+#define CHAR_LOG_AND_ECHO(...) \
+ do { \
+ PRINTF(__VA_ARGS__); \
+ CHAR_LOG(__VA_ARGS__); \
} while (0)
} // namespace char_
} // namespace tmwa
diff --git a/src/diagnostics.hpp b/src/diagnostics.hpp
index 4185334..3a10505 100644
--- a/src/diagnostics.hpp
+++ b/src/diagnostics.hpp
@@ -771,7 +771,7 @@ namespace tmwa
/// Warn when a noexcept expression evaluates to
/// false even though the expression can't actually
/// throw
-#define DIAG_noexcept "-Wnoexcept"
+#define DIAG_noexcept "-Wno-noexcept-type -Wnoexcept"
#if GCC
# define HAS_DIAG_noexcept 1
#else
diff --git a/src/io/cxxstdio.hpp b/src/io/cxxstdio.hpp
index 7312382..08c9a53 100644
--- a/src/io/cxxstdio.hpp
+++ b/src/io/cxxstdio.hpp
@@ -81,14 +81,14 @@ namespace cxxstdio
}
};
-#define XPRINTF(out, fmt, ...) \
- ({ \
- struct format_impl \
- { \
- constexpr static \
- FormatString print_format() { return fmt; } \
- }; \
- cxxstdio::PrintFormatter<format_impl>::print(out, ## __VA_ARGS__); \
+#define XPRINTF(out, fmt, ...) \
+ ({ \
+ struct format_impl \
+ { \
+ constexpr static \
+ FormatString print_format() __asm__("_print_format") { return fmt; } \
+ }; \
+ cxxstdio::PrintFormatter<format_impl>::print(out, ## __VA_ARGS__); \
})
#define FPRINTF(file, fmt, ...) XPRINTF(/*no_cast<FILE *>*/(file), fmt, ## __VA_ARGS__)
diff --git a/src/login/login.cpp b/src/login/login.cpp
index 68898ca..8e2c776 100644
--- a/src/login/login.cpp
+++ b/src/login/login.cpp
@@ -145,9 +145,9 @@ struct mmo_account
#define LOGIN_LOG(fmt, ...) \
tmwa::login::login_log(STRPRINTF(fmt, ## __VA_ARGS__))
#define LOGIN_LOG_AND_ECHO(...) \
- do { \
- PRINTF(__VA_ARGS__); \
- LOGIN_LOG(__VA_ARGS__); \
+ do { \
+ PRINTF(__VA_ARGS__); \
+ LOGIN_LOG(__VA_ARGS__); \
} while (0)
static
void login_log(XString line)
diff --git a/src/map/map.hpp b/src/map/map.hpp
index 2f6ef21..60b3462 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -584,10 +584,10 @@ void map_log(XString line);
#define MAP_LOG(format, ...) \
map_log(STRPRINTF(format, ## __VA_ARGS__))
-#define MAP_LOG_AND_ECHO(...) \
- do { \
- PRINTF(__VA_ARGS__); \
- MAP_LOG(__VA_ARGS__); \
+#define MAP_LOG_AND_ECHO(...) \
+ do { \
+ PRINTF(__VA_ARGS__); \
+ MAP_LOG(__VA_ARGS__); \
} while (0)
#define MAP_LOG_PC(sd, fmt, ...) \
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 8292bdb..ab60535 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -4150,8 +4150,10 @@ void builtin_npcareawarp(ScriptState *st)
}
}
else
+ {
x = random_::in(x0, x1);
y = random_::in(y0, y1);
+ }
npc_enable(npc, 0);
map_delblock(nd); /* [Freeyorp] */
diff --git a/src/warnings.hpp b/src/warnings.hpp
index 8f545e3..9f4605b 100644
--- a/src/warnings.hpp
+++ b/src/warnings.hpp
@@ -33,7 +33,7 @@ PRAGMA(GCC diagnostic warning "-Wextra");
PRAGMA(GCC diagnostic warning "-Wunused");
PRAGMA(GCC diagnostic warning "-Wformat");
-DIAG_E(abi);
+DIAG_W(abi);
DIAG_I(abi_tag);
DIAG_E(address);
DIAG_I(aggregate_return);