mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
get rid of PR_GetArray: it's redundant
This commit is contained in:
parent
93169e1b91
commit
0477b43f80
3 changed files with 4 additions and 25 deletions
|
@ -67,9 +67,6 @@ extern def_t def_ret, def_parms[MAX_PARMS];
|
|||
extern def_t def_void;
|
||||
extern def_t def_function;
|
||||
|
||||
struct def_s *PR_GetArray (struct type_s *etype, const char *name, int size,
|
||||
struct def_s *scope, int *allocate);
|
||||
|
||||
struct def_s *PR_GetDef (struct type_s *type, const char *name,
|
||||
struct def_s *scope, int *allocate);
|
||||
struct def_s *PR_NewDef (struct type_s *type, const char *name,
|
||||
|
|
|
@ -91,23 +91,6 @@ check_for_name (type_t *type, const char *name, def_t *scope, int *allocate)
|
|||
return 0;
|
||||
}
|
||||
|
||||
def_t *
|
||||
PR_GetArray (type_t *etype, const char *name, int size, def_t *scope,
|
||||
int *allocate)
|
||||
{
|
||||
type_t *type = pointer_type (etype);
|
||||
def_t *def = check_for_name (type, name, scope, allocate);
|
||||
|
||||
if (def || !allocate)
|
||||
return def;
|
||||
def = PR_NewDef (type, name, scope);
|
||||
def->ofs = *allocate;
|
||||
def->initialized = def->constant = 1;
|
||||
*allocate += type_size (type) * size + 1;
|
||||
G_INT (def->ofs) = def->ofs + 1;
|
||||
return def;
|
||||
}
|
||||
|
||||
/*
|
||||
PR_GetDef
|
||||
|
||||
|
|
|
@ -291,17 +291,16 @@ build_switch (expr_t *sw, case_node_t *tree, int op, expr_t *sw_val,
|
|||
int low = tree->low->e.integer_val;
|
||||
int high = tree->high->e.integer_val;
|
||||
def_t *def;
|
||||
expr_t *table = new_expr ();
|
||||
expr_t *table;
|
||||
const char *name = new_label_name ();
|
||||
int i;
|
||||
expr_t *range = binary_expr ('-', tree->high, tree->low);
|
||||
|
||||
range->type = ex_uinteger;
|
||||
|
||||
def = PR_GetArray (&type_uinteger, name, high - low + 1, 0,
|
||||
def = PR_GetDef (array_type (&type_uinteger, high - low + 1), name, 0,
|
||||
&pr.num_globals);
|
||||
table->type = ex_def;
|
||||
table->e.def = def;
|
||||
table = new_def_expr (def);
|
||||
|
||||
if (tree->left) {
|
||||
branch = new_binary_expr (IFB, temp, low_label);
|
||||
|
|
Loading…
Reference in a new issue