From c39b1a665114ad2a8231f0ea69f9c730cc434070 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 31 Jul 2013 07:02:04 +0200 Subject: Added a few forgotten references. --- includes/BLua.h | 4 ++-- src/BLua.cc | 6 +++--- src/Handle.cc | 4 ++-- src/LuaTask.cc | 2 +- src/Main.cc | 6 +++--- src/TaskMan.cc | 7 ++++--- src/Threads.cc | 6 +++--- tests/test-Handles.cc | 2 +- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/includes/BLua.h b/includes/BLua.h index 8756f0f..926782a 100644 --- a/includes/BLua.h +++ b/includes/BLua.h @@ -350,7 +350,7 @@ class LuaHelpers : public LuaHelpersBase { try { r = method_multiplex_internal(caller, L, proceed, proceed_static, tab, method); } - catch (EAgain e) { + catch (EAgain & e) { pushContext(L, [caller, proceed, proceed_static, tab, method](Lua & L) -> int { return method_multiplex_resume(caller, L, proceed, proceed_static, tab, method); }, e.getEvent()); r = L.yield(L.gettop()); } @@ -364,7 +364,7 @@ class LuaHelpers : public LuaHelpersBase { try { r = method_multiplex_internal(caller, L, proceed, proceed_static, tab, method); } - catch (EAgain e) { + catch (EAgain & e) { pushContext(L, [caller, proceed, proceed_static, tab, method](Lua & L) -> int { return method_multiplex_resume(caller, L, proceed, proceed_static, tab, method); }, e.getEvent()); r = -1; } diff --git a/src/BLua.cc b/src/BLua.cc index cb0e645..48a3305 100644 --- a/src/BLua.cc +++ b/src/BLua.cc @@ -210,10 +210,10 @@ int Balau::LuaStatics::callwrap(lua_State * __L, lua_CFunction func) { try { return func(__L); } - catch (LuaException e) { + catch (LuaException & e) { L.error(String("LuaException: ") + e.getMsg()); } - catch (Balau::GeneralException e) { + catch (Balau::GeneralException & e) { L.error(String("GeneralException: ") + e.getMsg()); } // LuaJIT sucks sometime. @@ -486,7 +486,7 @@ const char * Balau::LuaStatics::getF(lua_State * L, void * ud, size_t * size) { try { *size = lf->f->read(lf->buff, BUFFERSIZE); } - catch (GeneralException e) { + catch (GeneralException & e) { lf->exception = new GeneralException(e); AssertHelper("LuaJIT is lame."); } diff --git a/src/Handle.cc b/src/Handle.cc index 11f64d6..67eb412 100644 --- a/src/Handle.cc +++ b/src/Handle.cc @@ -51,7 +51,7 @@ ssize_t Balau::Handle::forceRead(void * _buf, size_t count, Events::BaseEvent * try { r = read(buf, count); } - catch (EAgain e) { + catch (EAgain & e) { if (evt && evt->gotSignal()) return total; Task::operationYield(e.getEvent()); @@ -78,7 +78,7 @@ ssize_t Balau::Handle::forceWrite(const void * _buf, size_t count, Events::BaseE try { r = write(buf, count); } - catch (EAgain e) { + catch (EAgain & e) { if (evt && evt->gotSignal()) return total; Task::operationYield(e.getEvent()); diff --git a/src/LuaTask.cc b/src/LuaTask.cc index 30fdef2..fa94621 100644 --- a/src/LuaTask.cc +++ b/src/LuaTask.cc @@ -69,7 +69,7 @@ void Balau::LuaTask::Do() { else m_cell->run(L); } - catch (GeneralException e) { + catch (GeneralException & e) { m_cell->m_exception = new GeneralException(e); } catch (...) { diff --git a/src/Main.cc b/src/Main.cc index baf55d4..7c205d4 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -60,7 +60,7 @@ int Balau::Main::bootstrap(int argc, char ** argv) { r = TaskMan::getDefaultTaskMan()->mainLoop(); m_status = STOPPING; } - catch (Exit e) { + catch (Exit & e) { m_status = STOPPING; Printer::log(M_ERROR, "We shouldn't have gotten an Exit exception here... exitting anyway"); auto trace = e.getTrace(); @@ -68,7 +68,7 @@ int Balau::Main::bootstrap(int argc, char ** argv) { Printer::log(M_ERROR, "%s", str.to_charp()); r = e.getCode(); } - catch (RessourceException e) { + catch (RessourceException & e) { m_status = STOPPING; Printer::log(M_ERROR | M_ALERT, "The application got a ressource problem: %s", e.getMsg()); const char * details = e.getDetails(); @@ -79,7 +79,7 @@ int Balau::Main::bootstrap(int argc, char ** argv) { Printer::log(M_DEBUG, "%s", str.to_charp()); r = -1; } - catch (GeneralException e) { + catch (GeneralException & e) { m_status = STOPPING; Printer::log(M_ERROR | M_ALERT, "The application caused an exception: %s", e.getMsg()); const char * details = e.getDetails(); diff --git a/src/TaskMan.cc b/src/TaskMan.cc index 177cec1..398fa87 100644 --- a/src/TaskMan.cc +++ b/src/TaskMan.cc @@ -1,3 +1,4 @@ + #include "Async.h" #include "TaskMan.h" #include "Task.h" @@ -391,13 +392,13 @@ void * Balau::TaskMan::TaskManThread::proc() { m_taskMan->mainLoop(); success = true; } - catch (Exit e) { + catch (Exit & e) { Printer::log(M_ERROR, "We shouldn't have gotten an Exit exception here... exitting anyway"); auto trace = e.getTrace(); for (String & str : trace) Printer::log(M_ERROR, "%s", str.to_charp()); } - catch (RessourceException e) { + catch (RessourceException & e) { Printer::log(M_ERROR | M_ALERT, "The TaskMan thread got a ressource problem: %s", e.getMsg()); const char * details = e.getDetails(); if (details) @@ -406,7 +407,7 @@ void * Balau::TaskMan::TaskManThread::proc() { for (String & str : trace) Printer::log(M_DEBUG, "%s", str.to_charp()); } - catch (GeneralException e) { + catch (GeneralException & e) { Printer::log(M_ERROR | M_ALERT, "The TaskMan thread caused an exception: %s", e.getMsg()); const char * details = e.getDetails(); if (details) diff --git a/src/Threads.cc b/src/Threads.cc index 7b1b7bc..6de9186 100644 --- a/src/Threads.cc +++ b/src/Threads.cc @@ -50,13 +50,13 @@ void * Balau::ThreadHelper::threadProc(void * arg) { free(tls); success = true; } - catch (Exit e) { + catch (Exit & e) { Printer::log(M_ERROR, "We shouldn't have gotten an Exit exception here... exitting anyway"); auto trace = e.getTrace(); for (String & str : trace) Printer::log(M_ERROR, "%s", str.to_charp()); } - catch (RessourceException e) { + catch (RessourceException & e) { Printer::log(M_ERROR | M_ALERT, "The Thread got a ressource problem: %s", e.getMsg()); const char * details = e.getDetails(); if (details) @@ -65,7 +65,7 @@ void * Balau::ThreadHelper::threadProc(void * arg) { for (String & str : trace) Printer::log(M_DEBUG, "%s", str.to_charp()); } - catch (GeneralException e) { + catch (GeneralException & e) { Printer::log(M_ERROR | M_ALERT, "The Thread caused an exception: %s", e.getMsg()); const char * details = e.getDetails(); if (details) diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc index c411c46..39c51e3 100644 --- a/tests/test-Handles.cc +++ b/tests/test-Handles.cc @@ -116,7 +116,7 @@ void SimpleTaskTest::Do() { IO i(new Input("SomeInexistantFile.txt")); i->open(); } - catch (ENoEnt e) { + catch (ENoEnt & e) { failed = true; } TAssert(failed); -- cgit v1.2.3