]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
change choice of diagnostics for ftepp to use lex_ctx instance. Cleaned up C++ style...
authorDale Weiler <killfieldengine@gmail.com>
Fri, 23 Nov 2012 02:29:01 +0000 (02:29 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Fri, 23 Nov 2012 02:29:01 +0000 (02:29 +0000)
ftepp.c
test.c

diff --git a/ftepp.c b/ftepp.c
index 158daa1a16ec19f64a0805ed654894eff3e58a95..6f2bb9316e9dc0578dfc1a0367e7ddfe082c5b83 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -77,7 +77,7 @@ static void ftepp_errorat(ftepp_t *ftepp, lex_ctx ctx, const char *fmt, ...)
     ftepp->errors++;
 
     va_start(ap, fmt);
-    con_vprintmsg(LVL_ERROR, ctx.file, ctx.line, "error", fmt, ap);
+    con_cvprintmsg((void*)&ctx, LVL_ERROR, "error", fmt, ap);
     va_end(ap);
 }
 
@@ -88,7 +88,7 @@ static void ftepp_error(ftepp_t *ftepp, const char *fmt, ...)
     ftepp->errors++;
 
     va_start(ap, fmt);
-    con_vprintmsg(LVL_ERROR, ftepp->lex->tok.ctx.file, ftepp->lex->tok.ctx.line, "error", fmt, ap);
+    con_cvprintmsg((void*)&ftepp->lex->tok.ctx, LVL_ERROR, "error", fmt, ap);
     va_end(ap);
 }
 
@@ -106,7 +106,7 @@ static bool GMQCC_WARN ftepp_warn(ftepp_t *ftepp, int warntype, const char *fmt,
     }
 
     va_start(ap, fmt);
-    con_vprintmsg(lvl, ftepp->lex->tok.ctx.file, ftepp->lex->tok.ctx.line, "error", fmt, ap);
+    con_cvprintmsg((void*)&ftepp->lex->tok.ctx, lvl, "error", fmt, ap);
     va_end(ap);
     return opts_werror;
 }
diff --git a/test.c b/test.c
index 442c1350ddef37d3186ef373f6384f9380deff46..fa4e426f9150c981f01648f751303ab948f0c1fb 100644 (file)
--- a/test.c
+++ b/test.c
@@ -571,8 +571,6 @@ void task_template_destroy(task_template_t **template) {
      * checks will fail if template pointer is reused.
      */
     mem_d(*template);
-    //task_template_nullify(*template);
-    //*template = NULL;
 }
 
 /*
@@ -622,8 +620,11 @@ bool task_propogate(const char *curdir) {
          * actually a directory, so it must be a file :)
          */
         if (strstr(files->d_name, ".tmpl") == &files->d_name[strlen(files->d_name) - (sizeof(".tmpl") - 1)]) {
-            util_debug("TEST", "compiling task template: %s/%s\n", curdir, files->d_name);
             task_template_t *template = task_template_compile(files->d_name, curdir);
+            char             buf[4096]; /* one page should be enough */
+            task_t           task;
+            
+            util_debug("TEST", "compiling task template: %s/%s\n", curdir, files->d_name);
             if (!template) {
                 con_err("error compiling task template: %s\n", files->d_name);
                 success = false;
@@ -640,7 +641,6 @@ bool task_propogate(const char *curdir) {
              * which will be refered to with a handle in the task for
              * reading the data from the pipe.
              */
-            char     buf[4096]; /* one page should be enough */
             memset  (buf,0,sizeof(buf));
             snprintf(buf,  sizeof(buf), "%s %s/%s %s -o %s",
                 task_bins[TASK_COMPILE],
@@ -654,7 +654,6 @@ bool task_propogate(const char *curdir) {
              * The task template was compiled, now lets create a task from
              * the template data which has now been propogated.
              */
-            task_t task;
             task.template = template;
             if (!(task.runhandles = task_popen(buf, "r"))) {
                 con_err("error opening pipe to process for test: %s\n", template->description);
@@ -882,9 +881,9 @@ void task_schedualize(const char *curdir) {
     
     for (i = 0; i < vec_size(task_tasks); i++) {
         /*
-        * Generate a task from thin air if it requires execution in
-        * the QCVM.
-        */
+         * Generate a task from thin air if it requires execution in
+         * the QCVM.
+         */
         if (!strcmp(task_tasks[i].template->proceduretype, "-execute"))
             execute = true;
             
@@ -919,8 +918,6 @@ void task_schedualize(const char *curdir) {
             fputs(data, task_tasks[i].stderrlog);
             fflush(task_tasks[i].stdoutlog);
         }
-        //mem_d(data);
-        
         
         /*
          * If we can execute we do so after all data has been read and