]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Remove some trailing whitespace
authorDale Weiler <killfieldengine@gmail.com>
Sat, 17 Aug 2013 23:43:41 +0000 (23:43 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sat, 17 Aug 2013 23:43:41 +0000 (23:43 +0000)
ast.c
fold.c
intrin.c
pak.c
parser.c
stat.c
test.c
util.c

diff --git a/ast.c b/ast.c
index bcc2f8ef3f4bc4fb3887facfa047a6c6c6fef712..32ab1a2781bb60dab72082721eed7ef0408c6019 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -2536,7 +2536,7 @@ bool ast_ifthen_codegen(ast_ifthen *self, ast_function *func, bool lvalue, ir_va
     /* try constant folding away the if */
     if ((fold = fold_cond(condval, func, self)) != -1)
         return fold;
     /* try constant folding away the if */
     if ((fold = fold_cond(condval, func, self)) != -1)
         return fold;
-    
+
     if (self->on_true) {
         /* create on-true block */
         ontrue = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "ontrue"));
     if (self->on_true) {
         /* create on-true block */
         ontrue = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "ontrue"));
diff --git a/fold.c b/fold.c
index 500e9d65494e9edd972a459755ca2982e9c5ed67..b1e89c34940c70037e3953b16eafd420d0afe6f6 100644 (file)
--- a/fold.c
+++ b/fold.c
@@ -34,7 +34,7 @@
  * stage constant folding, where, witht he help of the AST, operator
  * usages can be constant folded. Then there is the constant folding
  * in the IR for things like eliding if statements, can occur.
  * stage constant folding, where, witht he help of the AST, operator
  * usages can be constant folded. Then there is the constant folding
  * in the IR for things like eliding if statements, can occur.
- * 
+ *
  * This file is thus, split into two parts.
  */
 
  * This file is thus, split into two parts.
  */
 
@@ -46,7 +46,7 @@
 /*
  * Implementation of basic vector math for vec3_t, for trivial constant
  * folding.
 /*
  * Implementation of basic vector math for vec3_t, for trivial constant
  * folding.
- * 
+ *
  * TODO: gcc/clang hinting for autovectorization
  */
 static GMQCC_INLINE vec3_t vec3_add(vec3_t a, vec3_t b) {
  * TODO: gcc/clang hinting for autovectorization
  */
 static GMQCC_INLINE vec3_t vec3_add(vec3_t a, vec3_t b) {
@@ -138,7 +138,7 @@ static GMQCC_INLINE bool fold_immediate_true(fold_t *fold, ast_value *v) {
             return !!v->constval.vfloat;
         case TYPE_INTEGER:
             return !!v->constval.vint;
             return !!v->constval.vfloat;
         case TYPE_INTEGER:
             return !!v->constval.vint;
-        case TYPE_VECTOR: 
+        case TYPE_VECTOR:
             if (OPTS_FLAG(CORRECT_LOGIC))
                 return vec3_pbool(v->constval.vvec);
             return !!(v->constval.vvec.x);
             if (OPTS_FLAG(CORRECT_LOGIC))
                 return vec3_pbool(v->constval.vvec);
             return !!(v->constval.vvec.x);
@@ -295,7 +295,7 @@ static GMQCC_INLINE ast_expression *fold_op_mul_vec(fold_t *fold, vec3_t vec, as
     /*
      * vector-component constant folding works by matching the component sets
      * to eliminate expensive operations on whole-vectors (3 components at runtime).
     /*
      * vector-component constant folding works by matching the component sets
      * to eliminate expensive operations on whole-vectors (3 components at runtime).
-     * to achive this effect in a clean manner this function generalizes the 
+     * to achive this effect in a clean manner this function generalizes the
      * values through the use of a set paramater, which is used as an indexing method
      * for creating the elided ast binary expression.
      *
      * values through the use of a set paramater, which is used as an indexing method
      * for creating the elided ast binary expression.
      *
@@ -307,7 +307,7 @@ static GMQCC_INLINE ast_expression *fold_op_mul_vec(fold_t *fold, vec3_t vec, as
      * vec.z is the same as set[2]-'x' for when set[2] is 'z', 'z'-'x' results in a
      * literal value of 2, using this 2, we know that taking the address of vec->x (float)
      * and indxing it with this literal will yeild the immediate address of that component
      * vec.z is the same as set[2]-'x' for when set[2] is 'z', 'z'-'x' results in a
      * literal value of 2, using this 2, we know that taking the address of vec->x (float)
      * and indxing it with this literal will yeild the immediate address of that component
-     * 
+     *
      * Of course more work needs to be done to generate the correct index for the ast_member_new
      * call, which is no problem: set[0]-'x' suffices that job.
      */
      * Of course more work needs to be done to generate the correct index for the ast_member_new
      * call, which is no problem: set[0]-'x' suffices that job.
      */
@@ -490,7 +490,7 @@ static GMQCC_INLINE ast_expression *fold_op_andor(fold_t *fold, ast_value *a, as
                 return (ast_expression*)b;
         } else {
             return fold_constgen_float (
                 return (ast_expression*)b;
         } else {
             return fold_constgen_float (
-                fold, 
+                fold,
                 ((expr) ? (fold_immediate_true(fold, a) || fold_immediate_true(fold, b))
                         : (fold_immediate_true(fold, a) && fold_immediate_true(fold, b)))
                             ? 1
                 ((expr) ? (fold_immediate_true(fold, a) || fold_immediate_true(fold, b))
                         : (fold_immediate_true(fold, a) && fold_immediate_true(fold, b)))
                             ? 1
index 30c7424ccae533954b26d966551952a40e5d7dfe..e4f398615464c5be06d8307cd458ae12c02e4891 100644 (file)
--- a/intrin.c
+++ b/intrin.c
@@ -351,7 +351,7 @@ static ast_expression *intrin_isnan(intrin_t *intrin) {
 #undef INTRIN_REG
 #undef INTRIN_VAL
 
 #undef INTRIN_REG
 #undef INTRIN_VAL
 
-/* 
+/*
  * TODO: make static (and handle ast_type_string) here for the builtin
  * instead of in SYA parse close.
  */
  * TODO: make static (and handle ast_type_string) here for the builtin
  * instead of in SYA parse close.
  */
@@ -365,7 +365,7 @@ static const intrin_func_t intrinsics[] = {
     {&intrin_mod,              "__builtin_mod",              "mod"},
     {&intrin_pow,              "__builtin_pow",              "pow"},
     {&intrin_isnan,            "__builtin_isnan",            "isnan"},
     {&intrin_mod,              "__builtin_mod",              "mod"},
     {&intrin_pow,              "__builtin_pow",              "pow"},
     {&intrin_isnan,            "__builtin_isnan",            "isnan"},
-    {&intrin_debug_typestring, "__builtin_debug_typestring", ""} 
+    {&intrin_debug_typestring, "__builtin_debug_typestring", ""}
 };
 
 static void intrin_error(intrin_t *intrin, const char *fmt, ...) {
 };
 
 static void intrin_error(intrin_t *intrin, const char *fmt, ...) {
diff --git a/pak.c b/pak.c
index f2f2252d4fd615fdd440ff4358dbe7e1e6c0b546..0b3f2216e2b4777c7892cedc0d04f72dfd4378f4 100644 (file)
--- a/pak.c
+++ b/pak.c
@@ -304,7 +304,7 @@ static bool pak_extract_one(pak_file_t *pak, const char *file, const char *outdi
 
     mem_d(dat);
     return true;
 
     mem_d(dat);
     return true;
-    
+
 err:
     if (dat) mem_d(dat);
     if (out) fs_file_close(out);
 err:
     if (dat) mem_d(dat);
     if (out) fs_file_close(out);
index 87b87264b123a4b13e87428f8d71b5f3525f5209..a2ab3ca9b903a103e079039a9edc1550c94ecc11 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -806,7 +806,7 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
                     ty1, ty2);
                 return false;
             }
                     ty1, ty2);
                 return false;
             }
-            
+
             if (!(out = fold_op(parser->fold, op, exprs))) {
                 ast_call *gencall = ast_call_new(parser_ctx(parser), intrin_func(parser->intrin, "pow"));
                 vec_push(gencall->params, exprs[0]);
             if (!(out = fold_op(parser->fold, op, exprs))) {
                 ast_call *gencall = ast_call_new(parser_ctx(parser), intrin_func(parser->intrin, "pow"));
                 vec_push(gencall->params, exprs[0]);
@@ -823,7 +823,7 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
                     ty1, ty2);
 
                 return false;
                     ty1, ty2);
 
                 return false;
-            } 
+            }
 
             if (!(out = fold_op(parser->fold, op, exprs))) {
                 ast_binary *eq = ast_binary_new(ctx, INSTR_EQ_F, exprs[0], exprs[1]);
 
             if (!(out = fold_op(parser->fold, op, exprs))) {
                 ast_binary *eq = ast_binary_new(ctx, INSTR_EQ_F, exprs[0], exprs[1]);
@@ -1193,7 +1193,7 @@ static bool parser_close_call(parser_t *parser, shunt *sy)
         return false;
     }
 
         return false;
     }
 
-    /* 
+    /*
      * TODO handle this at the intrinsic level with an ast_intrinsic
      * node and codegen.
      */
      * TODO handle this at the intrinsic level with an ast_intrinsic
      * node and codegen.
      */
@@ -1552,7 +1552,7 @@ static bool parse_sya_operand(parser_t *parser, shunt *sy, bool with_labels)
         if (!var && !strcmp(parser_tokval(parser), "__FUNC__"))
             var = (ast_expression*)fold_constgen_string(parser->fold, parser->function->name, false);
         if (!var) {
         if (!var && !strcmp(parser_tokval(parser), "__FUNC__"))
             var = (ast_expression*)fold_constgen_string(parser->fold, parser->function->name, false);
         if (!var) {
-            /* 
+            /*
              * now we try for the real intrinsic hashtable. If the string
              * begins with __builtin, we simply skip past it, otherwise we
              * use the identifier as is.
              * now we try for the real intrinsic hashtable. If the string
              * begins with __builtin, we simply skip past it, otherwise we
              * use the identifier as is.
@@ -5984,7 +5984,7 @@ static void parser_remove_ast(parser_t *parser)
     if (parser->reserved_version)
         ast_value_delete(parser->reserved_version);
 
     if (parser->reserved_version)
         ast_value_delete(parser->reserved_version);
 
-    util_htdel(parser->aliases); 
+    util_htdel(parser->aliases);
     fold_cleanup(parser->fold);
     intrin_cleanup(parser->intrin);
 }
     fold_cleanup(parser->fold);
     intrin_cleanup(parser->intrin);
 }
diff --git a/stat.c b/stat.c
index 7a2d195b6ba2e3a2d75daa6ed322076aad4f2836..1d17db2df58754218a477e23fb7af05bdb54f384 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -159,7 +159,7 @@ void stat_mem_deallocate(void *ptr) {
 
     info = ((stat_mem_block_t*)ptr - 1);
 
 
     info = ((stat_mem_block_t*)ptr - 1);
 
-    /* 
+    /*
      * we need access to the redzone that represents the info block
      * so lets do that.
      */
      * we need access to the redzone that represents the info block
      * so lets do that.
      */
@@ -228,7 +228,7 @@ void *stat_mem_reallocate(void *ptr, size_t size, size_t line, const char *file)
         /* don't need access anymore */
         VALGRIND_MAKE_MEM_NOACCESS(oldinfo->prev, sizeof(stat_mem_block_t));
     }
         /* don't need access anymore */
         VALGRIND_MAKE_MEM_NOACCESS(oldinfo->prev, sizeof(stat_mem_block_t));
     }
-    
+
     if (oldinfo->next) {
         /* just need access for a short period */
         VALGRIND_MAKE_MEM_DEFINED(oldinfo->next, sizeof(stat_mem_block_t));
     if (oldinfo->next) {
         /* just need access for a short period */
         VALGRIND_MAKE_MEM_DEFINED(oldinfo->next, sizeof(stat_mem_block_t));
@@ -250,7 +250,7 @@ void *stat_mem_reallocate(void *ptr, size_t size, size_t line, const char *file)
     newinfo->prev = NULL;
     newinfo->next = stat_mem_block_root;
 
     newinfo->prev = NULL;
     newinfo->next = stat_mem_block_root;
 
-    /* 
+    /*
      * likely since the only time there is no root is when it's
      * being initialized first.
      */
      * likely since the only time there is no root is when it's
      * being initialized first.
      */
@@ -268,7 +268,7 @@ void *stat_mem_reallocate(void *ptr, size_t size, size_t line, const char *file)
     stat_mem_allocated += newinfo->size;
     stat_mem_high      += newinfo->size;
 
     stat_mem_allocated += newinfo->size;
     stat_mem_high      += newinfo->size;
 
-    /* 
+    /*
      * we're finished with the redzones, lets kill the access
      * to them.
      */
      * we're finished with the redzones, lets kill the access
      * to them.
      */
@@ -718,7 +718,7 @@ static void stat_dump_mem_leaks(void) {
 
         stat_dump_mem_contents(info, OPTS_OPTION_U16(OPTION_MEMDUMPCOLS));
 
 
         stat_dump_mem_contents(info, OPTS_OPTION_U16(OPTION_MEMDUMPCOLS));
 
-        /* 
+        /*
          * we're finished with the access, the redzone should be marked
          * inaccesible so that invalid read/writes that could 'step-into'
          * those redzones will show up as invalid read/writes in valgrind.
          * we're finished with the access, the redzone should be marked
          * inaccesible so that invalid read/writes that could 'step-into'
          * those redzones will show up as invalid read/writes in valgrind.
diff --git a/test.c b/test.c
index e4873e0e83d79fa1d8d3f1b59add6aa6b7ba813e..f3aa6bb43e3cc9b0b217b3071a18a1367ab41a12 100644 (file)
--- a/test.c
+++ b/test.c
@@ -684,7 +684,7 @@ static bool task_propagate(const char *curdir, size_t *pad, const char *defs) {
     char           **directories = NULL;
     char            *claim = util_strdup(curdir);
     size_t           i;
     char           **directories = NULL;
     char            *claim = util_strdup(curdir);
     size_t           i;
-    
+
     vec_push(directories, claim);
     dir = fs_dir_open(claim);
 
     vec_push(directories, claim);
     dir = fs_dir_open(claim);
 
@@ -716,7 +716,7 @@ static bool task_propagate(const char *curdir, size_t *pad, const char *defs) {
      */
     for (i = 0; i < vec_size(directories); i++) {
         dir = fs_dir_open(directories[i]);
      */
     for (i = 0; i < vec_size(directories); i++) {
         dir = fs_dir_open(directories[i]);
-        
+
         while ((files = fs_dir_read(dir))) {
             util_snprintf(buffer, sizeof(buffer), "%s/%s", directories[i], files->d_name);
             if (stat(buffer, &directory) == -1) {
         while ((files = fs_dir_read(dir))) {
             util_snprintf(buffer, sizeof(buffer), "%s/%s", directories[i], files->d_name);
             if (stat(buffer, &directory) == -1) {
@@ -871,7 +871,7 @@ static bool task_propagate(const char *curdir, size_t *pad, const char *defs) {
                 vec_push(task_tasks, task);
             }
         }
                 vec_push(task_tasks, task);
             }
         }
-        
+
         fs_dir_close(dir);
         mem_d(directories[i]); /* free claimed memory */
     }
         fs_dir_close(dir);
         mem_d(directories[i]); /* free claimed memory */
     }
@@ -967,7 +967,7 @@ static bool task_trymatch(size_t i, char ***line) {
     FILE            *execute;
     char             buffer[4096];
     task_template_t *tmpl = task_tasks[i].tmpl;
     FILE            *execute;
     char             buffer[4096];
     task_template_t *tmpl = task_tasks[i].tmpl;
-    
+
     memset  (buffer,0,sizeof(buffer));
 
     if (!strcmp(tmpl->proceduretype, "-execute")) {
     memset  (buffer,0,sizeof(buffer));
 
     if (!strcmp(tmpl->proceduretype, "-execute")) {
@@ -1013,7 +1013,7 @@ static bool task_trymatch(size_t i, char ***line) {
          */
         if (!(execute = fs_file_open(task_tasks[i].stderrlogfile, "r")))
             return false;
          */
         if (!(execute = fs_file_open(task_tasks[i].stderrlogfile, "r")))
             return false;
-        
+
         process = false;
     }
 
         process = false;
     }
 
@@ -1025,7 +1025,7 @@ static bool task_trymatch(size_t i, char ***line) {
         char  *data    = NULL;
         size_t size    = 0;
         size_t compare = 0;
         char  *data    = NULL;
         size_t size    = 0;
         size_t compare = 0;
-        
+
         while (fs_file_getline(&data, &size, execute) != EOF) {
             if (!strcmp(data, "No main function found\n")) {
                 con_err("test failure: `%s` (No main function found) [%s]\n",
         while (fs_file_getline(&data, &size, execute) != EOF) {
             if (!strcmp(data, "No main function found\n")) {
                 con_err("test failure: `%s` (No main function found) [%s]\n",
@@ -1045,7 +1045,7 @@ static bool task_trymatch(size_t i, char ***line) {
              */
             if  (strrchr(data, '\n'))
                 *strrchr(data, '\n') = '\0';
              */
             if  (strrchr(data, '\n'))
                 *strrchr(data, '\n') = '\0';
-                
+
             /*
              * We remove the file/directory and stuff from the error
              * match messages when testing diagnostics.
             /*
              * We remove the file/directory and stuff from the error
              * match messages when testing diagnostics.
@@ -1139,7 +1139,7 @@ static size_t task_schedualize(size_t *pad) {
          * 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.
          */
-         
+
         /* diagnostic is not executed, but compare tested instead, like preproessor */
         execute = !! (!strcmp(task_tasks[i].tmpl->proceduretype, "-execute")) ||
                      (!strcmp(task_tasks[i].tmpl->proceduretype, "-pp"))      ||
         /* diagnostic is not executed, but compare tested instead, like preproessor */
         execute = !! (!strcmp(task_tasks[i].tmpl->proceduretype, "-execute")) ||
                      (!strcmp(task_tasks[i].tmpl->proceduretype, "-pp"))      ||
@@ -1270,7 +1270,7 @@ static size_t task_schedualize(size_t *pad) {
             failed++;
             continue;
         }
             failed++;
             continue;
         }
-        
+
         for (j = 0; j < vec_size(match); j++)
             mem_d(match[j]);
         vec_free(match);
         for (j = 0; j < vec_size(match); j++)
             mem_d(match[j]);
         vec_free(match);
diff --git a/util.c b/util.c
index 48977da8c6e9236906c866cc1d0beac2d57dc17c..f8c59828b9a6fbf32e94109c2a19bfdb5a694eec 100644 (file)
--- a/util.c
+++ b/util.c
@@ -27,7 +27,7 @@
 #include "gmqcc.h"
 
 /*
 #include "gmqcc.h"
 
 /*
- * Initially this was handled with a table in the gmqcc.h header, but 
+ * Initially this was handled with a table in the gmqcc.h header, but
  * much to my surprise the contents of the table was duplicated for
  * each translation unit, causing all these strings to be duplicated
  * for every .c file it was included into. This method culls back on
  * much to my surprise the contents of the table was duplicated for
  * each translation unit, causing all these strings to be duplicated
  * for every .c file it was included into. This method culls back on
@@ -211,7 +211,7 @@ uint16_t util_crc16(const char *k, int len, const short clamp) {
 }
 #endif
 
 }
 #endif
 
-/* 
+/*
  * modifier is the match to make and the transpsition from it, while add is the upper-value that determines the
  * transposion from uppercase to lower case.
  */
  * modifier is the match to make and the transpsition from it, while add is the upper-value that determines the
  * transposion from uppercase to lower case.
  */