From 502e45d904cabc320f95f0345b653dd6d72d8290 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 4 Oct 2018 00:38:43 +0200 Subject: [PATCH] More methods switched to lowercase naming scheme. --- src/base/assert.cpp | 7 ++++++- src/lol/base/assert.h | 19 ++++++++++++------- src/lolua/baselua.cpp | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/base/assert.cpp b/src/base/assert.cpp index c1eba8ae..8acdaab0 100644 --- a/src/base/assert.cpp +++ b/src/base/assert.cpp @@ -26,7 +26,10 @@ namespace lol { -void DumpStack() +namespace debug +{ + +void dump_stack() { #if EMSCRIPTEN /* This would require demangling but we don't care yet. */ @@ -83,5 +86,7 @@ void DumpStack() #endif } +} /* namespace debug */ + } /* namespace lol */ diff --git a/src/lol/base/assert.h b/src/lol/base/assert.h index 400915d3..d03cd2a6 100644 --- a/src/lol/base/assert.h +++ b/src/lol/base/assert.h @@ -27,23 +27,28 @@ namespace lol { -static inline void Abort() +static inline void abort() { //*(uint32_t *)nullptr = 0xdead; std::abort(); } -extern void DumpStack(); - /* FIXME: see http://stackoverflow.com/q/3596781/111461 for discussions * on implementing __debugbreak() on POSIX systems. */ -static inline void DebugAbort() +namespace debug +{ + +extern void dump_stack(); + +static inline void abort() { - lol::DumpStack(); + dump_stack(); #if defined _WIN32 __debugbreak(); #endif - lol::Abort(); + lol::abort(); +} + } #define LOL_CALL(macro, args) macro args @@ -141,7 +146,7 @@ static inline void DebugAbort() LOL_CALL(LOL_CAT(LOL_ERROR_, LOL_CALL(LOL_COUNT_TO_3, \ (__VA_ARGS__))), \ (__VA_ARGS__)); \ - lol::DebugAbort(); \ + lol::debug::abort(); \ } #endif diff --git a/src/lolua/baselua.cpp b/src/lolua/baselua.cpp index 4c48cb1e..da01c247 100644 --- a/src/lolua/baselua.cpp +++ b/src/lolua/baselua.cpp @@ -35,7 +35,7 @@ class LuaBaseData { char const *message = lua_tostring(l, -1); msg::error("%s\n", message); - DebugAbort(); + debug::abort(); return 0; }