summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-05-25 01:46:01 -0700
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-05-25 01:46:01 -0700
commit5bf938797c73e8526b9ba228a3338d3972c2dfcd (patch)
treea62cc49945f61a29bca481687c3e66bfc730aeb1 /src
parent383a221c5c70b664424cb0e48d04160c60aa3b24 (diff)
Creating a Balau project file.
Diffstat (limited to 'src')
-rw-r--r--src/BLua.cc6
-rw-r--r--src/HttpActionStatic.cc12
-rw-r--r--src/LuaBigInt.cc10
-rw-r--r--src/Task.cc2
4 files changed, 15 insertions, 15 deletions
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<Handle> 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;
}