mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 02:31:28 +00:00
Remove some trailing whitespace
This commit is contained in:
parent
2a79339735
commit
c64005966f
8 changed files with 31 additions and 31 deletions
2
ast.c
2
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;
|
||||
|
||||
|
||||
if (self->on_true) {
|
||||
/* create on-true block */
|
||||
ontrue = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "ontrue"));
|
||||
|
|
12
fold.c
12
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.
|
||||
*
|
||||
*
|
||||
* This file is thus, split into two parts.
|
||||
*/
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
|||
/*
|
||||
* 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) {
|
||||
|
@ -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;
|
||||
case TYPE_VECTOR:
|
||||
case TYPE_VECTOR:
|
||||
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).
|
||||
* 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.
|
||||
*
|
||||
|
@ -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
|
||||
*
|
||||
*
|
||||
* 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 (
|
||||
fold,
|
||||
fold,
|
||||
((expr) ? (fold_immediate_true(fold, a) || fold_immediate_true(fold, b))
|
||||
: (fold_immediate_true(fold, a) && fold_immediate_true(fold, b)))
|
||||
? 1
|
||||
|
|
4
intrin.c
4
intrin.c
|
@ -351,7 +351,7 @@ static ast_expression *intrin_isnan(intrin_t *intrin) {
|
|||
#undef INTRIN_REG
|
||||
#undef INTRIN_VAL
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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_debug_typestring, "__builtin_debug_typestring", ""}
|
||||
{&intrin_debug_typestring, "__builtin_debug_typestring", ""}
|
||||
};
|
||||
|
||||
static void intrin_error(intrin_t *intrin, const char *fmt, ...) {
|
||||
|
|
2
pak.c
2
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;
|
||||
|
||||
|
||||
err:
|
||||
if (dat) mem_d(dat);
|
||||
if (out) fs_file_close(out);
|
||||
|
|
10
parser.c
10
parser.c
|
@ -806,7 +806,7 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
|
|||
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]);
|
||||
|
@ -823,7 +823,7 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
|
|||
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]);
|
||||
|
@ -1193,7 +1193,7 @@ static bool parser_close_call(parser_t *parser, shunt *sy)
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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) {
|
||||
/*
|
||||
/*
|
||||
* 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);
|
||||
|
||||
util_htdel(parser->aliases);
|
||||
util_htdel(parser->aliases);
|
||||
fold_cleanup(parser->fold);
|
||||
intrin_cleanup(parser->intrin);
|
||||
}
|
||||
|
|
10
stat.c
10
stat.c
|
@ -159,7 +159,7 @@ void stat_mem_deallocate(void *ptr) {
|
|||
|
||||
info = ((stat_mem_block_t*)ptr - 1);
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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));
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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));
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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.
|
||||
|
|
18
test.c
18
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;
|
||||
|
||||
|
||||
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]);
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
||||
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';
|
||||
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
||||
for (j = 0; j < vec_size(match); j++)
|
||||
mem_d(match[j]);
|
||||
vec_free(match);
|
||||
|
|
4
util.c
4
util.c
|
@ -27,7 +27,7 @@
|
|||
#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
|
||||
|
@ -211,7 +211,7 @@ uint16_t util_crc16(const char *k, int len, const short clamp) {
|
|||
}
|
||||
#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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue