From 5bf938797c73e8526b9ba228a3338d3972c2dfcd Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 25 May 2014 01:46:01 -0700 Subject: Creating a Balau project file. --- src/BLua.cc | 6 ++---- src/HttpActionStatic.cc | 12 ++++++------ src/LuaBigInt.cc | 10 ++++++---- src/Task.cc | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/BLua.cc b/src/BLua.cc index d3e50b6..8d6b3ee 100644 --- a/src/BLua.cc +++ b/src/BLua.cc @@ -1066,7 +1066,7 @@ void Balau::LuaObjectFactory::pushMe(Lua & L, LuaObjectBase * o, const char * ob } Balau::LuaObjectBase * Balau::LuaObjectFactory::getMeInternal(Lua & L, int i) { - LuaObjectBase * o; + LuaObjectBase * o = NULL; if (L.istable(i)) { L.push("__obj"); @@ -1074,9 +1074,7 @@ Balau::LuaObjectBase * Balau::LuaObjectFactory::getMeInternal(Lua & L, int i) { if (!(o = (LuaObjectBase *) L.touserdata())) L.error("Table is not an object."); L.pop(); - } else if (L.isnil(i)) { - o = NULL; - } else { + } else if (!L.isnil(i)) { L.error("Not an object (not even a table)."); } diff --git a/src/HttpActionStatic.cc b/src/HttpActionStatic.cc index d340bfa..d1cecaf 100644 --- a/src/HttpActionStatic.cc +++ b/src/HttpActionStatic.cc @@ -1,8 +1,8 @@ -#include "HttpActionStatic.h" -#include "Input.h" -#include "TaskMan.h" -#include "HelperTasks.h" - +#include "HttpActionStatic.h" +#include "Input.h" +#include "TaskMan.h" +#include "HelperTasks.h" + bool Balau::HttpActionStatic::Do(HttpServer * server, Http::Request & req, HttpServer::Action::ActionMatch & match, IO out) throw (GeneralException) { HttpServer::Response response(server, req, out); String & fname = match.uri[1]; @@ -24,7 +24,7 @@ bool Balau::HttpActionStatic::Do(HttpServer * server, Http::Request & req, HttpS try { file->open(); } - catch (ENoEnt & e) { + catch (ENoEnt &) { error = true; } } diff --git a/src/LuaBigInt.cc b/src/LuaBigInt.cc index d70cc55..b608afd 100644 --- a/src/LuaBigInt.cc +++ b/src/LuaBigInt.cc @@ -134,7 +134,7 @@ int sLua_BigInt::BigInt_proceed_static(Lua & L, int n, int caller) { switch (caller) { case BIGINT_CONSTRUCTOR: { - BigInt * a; + BigInt * a = NULL; if (L.type() == LUA_TSTRING) { a = new BigInt(); s = L.tostring(1); @@ -155,9 +155,11 @@ int sLua_BigInt::BigInt_proceed_static(Lua & L, int n, int caller) { } else { L.error("Invalid arguments to BigInt:new"); } - LuaBigIntFactory o(a); - o.pushDestruct(L); - r = 1; + if (a) { + LuaBigIntFactory o(a); + o.pushDestruct(L); + r = 1; + } break; } } diff --git a/src/Task.cc b/src/Task.cc index 85cdafe..fe4d97a 100644 --- a/src/Task.cc +++ b/src/Task.cc @@ -136,7 +136,7 @@ void Balau::Task::coroutine() { Printer::elog(E_TASK, "Stackless task %s at %p is task-switching.", getName(), this); } } - catch (EAgain & e) { + catch (EAgain &) { Printer::log(M_ERROR, "Task %s at %p threw an EAgain - you should catch it and yield; the app will crash now", getName(), this); m_status = FAULTED; } -- cgit v1.2.3