diff options
author | deva <deva> | 2010-08-13 11:56:34 +0000 |
---|---|---|
committer | deva <deva> | 2010-08-13 11:56:34 +0000 |
commit | c58541468c5477323e35837a8f0aeaf41e5a0794 (patch) | |
tree | 4a215de3b61bf3a521edf2e6f67f00c3731b6dc7 /client/lua.cc | |
parent | 51122d8689f6fbb1061ee0b19f885ad8851dfd50 (diff) |
Fix one too many resets of the LUA stack.
Diffstat (limited to 'client/lua.cc')
-rw-r--r-- | client/lua.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/client/lua.cc b/client/lua.cc index 3dd5381..062e520 100644 --- a/client/lua.cc +++ b/client/lua.cc @@ -32,6 +32,9 @@ #include "luawidget.h" +#define DEBUG(fmt...) printf("LUA (%p)", this); printf(fmt); fflush(stdout) +//#define DEBUG(ftm...) + #define GLOBAL_POINTER "_pracroGlobalLUAObjectPointerThisShouldBeANameThatIsNotAccidentallyOverwritten" static int get_widget(lua_State *L) @@ -58,7 +61,7 @@ static int get_widget(lua_State *L) Widget *widget = lua->getWidget(name); - // printf("FIND: %s (%p)\n", name.toStdString().c_str(), widget); + // DEBUG("FIND: %s (%p)\n", name.toStdString().c_str(), widget); if(widget) { wdg_make_widget(L, widget); @@ -66,7 +69,7 @@ static int get_widget(lua_State *L) lua_pushnil(L); } - // printf("DONE\n"); + // DEBUG("DONE\n"); return 1; } @@ -111,7 +114,7 @@ QString LUA::runParser(QString program) return false; } - printf("Running %s\n", program.toStdString().c_str()); + DEBUG("Running %s\n", program.toStdString().c_str()); int top = lua_gettop(L); @@ -152,10 +155,10 @@ bool LUA::runScript(QString script, Widget *widget, QString name) return false; } - printf("Running %s script %s on %s widget.\n", - name.toStdString().c_str(), - script.toStdString().c_str(), - widget?widget->name().toStdString().c_str():"NULL"); + DEBUG("Running %s script %s on %s widget.\n", + name.toStdString().c_str(), + script.toStdString().c_str(), + widget?widget->name().toStdString().c_str():"NULL"); if(widget) { wdg_make_widget(L, widget); @@ -181,7 +184,7 @@ bool LUA::runScript(QString script, Widget *widget, QString name) void LUA::error(QString message) { - printf("LUA ERROR: %s\n", message.toStdString().c_str()); + DEBUG("LUA ERROR: %s\n", message.toStdString().c_str()); } Widget *LUA::getWidget(QString name) |