From ba57301e92831606a18289ec10c314edd756f311 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 14 Aug 2014 06:37:29 +1000 Subject: Considerable cleanup of the top level compiling code. --- src/LuaSL/LuaSL_main.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'src/LuaSL/LuaSL_main.c') diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c index 3ed9004..f316fdb 100644 --- a/src/LuaSL/LuaSL_main.c +++ b/src/LuaSL/LuaSL_main.c @@ -186,10 +186,6 @@ static void _compileCb(LuaCompiler *compiler) sendBack(compiler->client, compiler->SID, "compiled(true)"); else sendBack(compiler->client, compiler->SID, "compiled(false)"); - free(compiler->luaName); - free(compiler->SID); - free(compiler->file); - free(compiler); } static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Data *ev) @@ -218,7 +214,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D { char *temp; char *file; - LuaSL_compiler *compiler = calloc(1, sizeof(LuaSL_compiler)); + LuaCompiler *compiler = calloc(1, sizeof(LuaCompiler)); strcpy(buf, &command[8]); temp = buf; @@ -227,23 +223,13 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D temp++; temp[0] = '\0'; - compiler->compiler.file = strdup(file); - compiler->compiler.SID = strdup(SID); - compiler->compiler.client = ev->client; - compiler->compiler.data = ourGlobals; - compiler->compiler.cb = _compileCb; + compiler->file = strdup(file); + compiler->SID = strdup(SID); + compiler->client = ev->client; compiler->doConstants = FALSE; -#if COMPILE_THREADED - compiler->compiler.parser = (compileCb) compileLSL; - compileScript(&compiler->compiler); -#else - if (!compileLSL(compiler)) - { - compiler->compiler.bugCount++; - PE("Compile of %s failed in a mysterious way.", file); - _compileCb(&(compiler->compiler)); - } -#endif + compiler->parser = (compileCb) compileLSL; + compiler->cb = _compileCb; + compileScript(compiler, COMPILE_THREADED); } else if (0 == strncmp(command, "run(", 4)) { -- cgit v1.1