From 2f4fc005937e75d931eb6ef87a3fe16364d45113 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 26 Jun 2014 21:59:27 -0700 Subject: Stick everything in a namespace --- src/compat/attr.hpp | 3 +++ src/compat/cast.cpp | 5 +++++ src/compat/cast.hpp | 3 +++ src/compat/fun.hpp | 4 ++++ src/compat/fwd.hpp | 4 ++++ src/compat/iter.cpp | 5 +++++ src/compat/iter.hpp | 3 +++ src/compat/iter_test.cpp | 3 +++ src/compat/memory.cpp | 5 +++++ src/compat/memory.hpp | 3 +++ src/compat/nullpo.cpp | 4 ++++ src/compat/nullpo.hpp | 4 ++++ src/compat/rawmem.cpp | 5 +++++ src/compat/rawmem.hpp | 4 ++++ src/compat/time_t.cpp | 5 +++++ src/compat/time_t.hpp | 5 +++++ 16 files changed, 65 insertions(+) (limited to 'src/compat') diff --git a/src/compat/attr.hpp b/src/compat/attr.hpp index 531e6b4..73fcfc4 100644 --- a/src/compat/attr.hpp +++ b/src/compat/attr.hpp @@ -22,10 +22,13 @@ # include "fwd.hpp" +namespace tmwa +{ # ifdef __clang__ # define FALLTHROUGH [[clang::fallthrough]] # else # define FALLTHROUGH /* fallthrough */ # endif +} // namespace tmwa #endif // TMWA_COMPAT_ATTR_HPP diff --git a/src/compat/cast.cpp b/src/compat/cast.cpp index 43c0b53..482529d 100644 --- a/src/compat/cast.cpp +++ b/src/compat/cast.cpp @@ -19,3 +19,8 @@ // along with this program. If not, see . #include "../poison.hpp" + + +namespace tmwa +{ +} // namespace tmwa diff --git a/src/compat/cast.hpp b/src/compat/cast.hpp index b237df4..38a8997 100644 --- a/src/compat/cast.hpp +++ b/src/compat/cast.hpp @@ -25,6 +25,8 @@ # include +namespace tmwa +{ template const T& const_(T& t) { @@ -68,5 +70,6 @@ typename std::remove_pointer::type *sign_cast(U *u) static_assert(sizeof(T_) == sizeof(U), "sign cast must be same size"); return reinterpret_cast(u); } +} // namespace tmwa #endif // TMWA_COMPAT_CAST_HPP diff --git a/src/compat/fun.hpp b/src/compat/fun.hpp index 072bda0..53a0ed6 100644 --- a/src/compat/fun.hpp +++ b/src/compat/fun.hpp @@ -23,6 +23,10 @@ # include + +namespace tmwa +{ namespace ph = std::placeholders; +} // namespace tmwa #endif // TMWA_COMPAT_FUN_HPP diff --git a/src/compat/fwd.hpp b/src/compat/fwd.hpp index 46934b8..729b963 100644 --- a/src/compat/fwd.hpp +++ b/src/compat/fwd.hpp @@ -21,6 +21,10 @@ # include "../sanity.hpp" + +namespace tmwa +{ // meh, add more when I feel like it +} // namespace tmwa #endif // TMWA_COMPAT_FWD_HPP diff --git a/src/compat/iter.cpp b/src/compat/iter.cpp index f0ab0af..b6d6b63 100644 --- a/src/compat/iter.cpp +++ b/src/compat/iter.cpp @@ -19,3 +19,8 @@ // along with this program. If not, see . #include "../poison.hpp" + + +namespace tmwa +{ +} // namespace tmwa diff --git a/src/compat/iter.hpp b/src/compat/iter.hpp index 08c139e..7ed24da 100644 --- a/src/compat/iter.hpp +++ b/src/compat/iter.hpp @@ -24,6 +24,8 @@ # include +namespace tmwa +{ /// Simple class to use a pair of iterators with foreach template class IteratorPair @@ -149,5 +151,6 @@ IteratorPair> filter_iterator(C *c, F f=is_truthy) { return {FilterIterator(c, f), FilterIterator(c, f)}; } +} // namespace tmwa #endif // TMWA_COMPAT_ITER_HPP diff --git a/src/compat/iter_test.cpp b/src/compat/iter_test.cpp index f0e6031..71cc891 100644 --- a/src/compat/iter_test.cpp +++ b/src/compat/iter_test.cpp @@ -27,6 +27,8 @@ #include "../poison.hpp" +namespace tmwa +{ #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" TEST(iterpair, strings) @@ -158,3 +160,4 @@ TEST(iterpair, filter3) EXPECT_EQ(sum, 6); EXPECT_EQ(count, 3); } +} // namespace tmwa diff --git a/src/compat/memory.cpp b/src/compat/memory.cpp index 5db23b2..f9f2c22 100644 --- a/src/compat/memory.cpp +++ b/src/compat/memory.cpp @@ -19,3 +19,8 @@ // along with this program. If not, see . #include "../poison.hpp" + + +namespace tmwa +{ +} // namespace tmwa diff --git a/src/compat/memory.hpp b/src/compat/memory.hpp index 3a2af96..702951c 100644 --- a/src/compat/memory.hpp +++ b/src/compat/memory.hpp @@ -25,6 +25,8 @@ # include +namespace tmwa +{ template struct is_array_of_unknown_bound : std::is_same::type[]> @@ -42,5 +44,6 @@ typename std::enable_if::value, std::unique_ptr::type E; return std::unique_ptr(new E[sz]()); } +} // namespace tmwa #endif // TMWA_COMPAT_MEMORY_HPP diff --git a/src/compat/nullpo.cpp b/src/compat/nullpo.cpp index a31cc34..bb80b27 100644 --- a/src/compat/nullpo.cpp +++ b/src/compat/nullpo.cpp @@ -24,6 +24,9 @@ #include "../poison.hpp" + +namespace tmwa +{ /// Actual output function static void nullpo_info(const char *file, int line, const char *func) @@ -46,3 +49,4 @@ bool nullpo_chk(const char *file, int line, const char *func, nullpo_info(file, line, func); return 1; } +} // namespace tmwa diff --git a/src/compat/nullpo.hpp b/src/compat/nullpo.hpp index 5de8ab6..6e12f78 100644 --- a/src/compat/nullpo.hpp +++ b/src/compat/nullpo.hpp @@ -45,6 +45,9 @@ # include "fwd.hpp" + +namespace tmwa +{ /// Used by macros in this header bool nullpo_chk(const char *file, int line, const char *func, const void *target); @@ -59,5 +62,6 @@ bool nullpo_chk(const char *file, int line, const char *func, T *target) { return nullpo_chk(file, line, func, static_cast(target)); } +} // namespace tmwa #endif // TMWA_COMPAT_NULLPO_HPP diff --git a/src/compat/rawmem.cpp b/src/compat/rawmem.cpp index 74fdc0b..d322437 100644 --- a/src/compat/rawmem.cpp +++ b/src/compat/rawmem.cpp @@ -19,3 +19,8 @@ // along with this program. If not, see . #include "../poison.hpp" + + +namespace tmwa +{ +} // namespace tmwa diff --git a/src/compat/rawmem.hpp b/src/compat/rawmem.hpp index f030963..dd038be 100644 --- a/src/compat/rawmem.hpp +++ b/src/compat/rawmem.hpp @@ -25,6 +25,9 @@ # include "fwd.hpp" + +namespace tmwa +{ inline void really_memcpy(uint8_t *dest, const uint8_t *src, size_t n) { @@ -47,5 +50,6 @@ void really_memset0(uint8_t *dest, size_t n) { memset(dest, '\0', n); } +} // namespace tmwa #endif // TMWA_COMPAT_RAWMEM_HPP diff --git a/src/compat/time_t.cpp b/src/compat/time_t.cpp index b1a3fb8..ee0bbde 100644 --- a/src/compat/time_t.cpp +++ b/src/compat/time_t.cpp @@ -19,3 +19,8 @@ // along with this program. If not, see . #include "../poison.hpp" + + +namespace tmwa +{ +} // namespace tmwa diff --git a/src/compat/time_t.hpp b/src/compat/time_t.hpp index 4e0ffb6..60005d0 100644 --- a/src/compat/time_t.hpp +++ b/src/compat/time_t.hpp @@ -24,4 +24,9 @@ // TODO fix this ordering violation by promoting TimeT here # include "../mmo/utils.hpp" + +namespace tmwa +{ +} // namespace tmwa + #endif // TMWA_COMPAT_TIMET_HPP -- cgit v1.2.3-60-g2f50