mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 18:31:27 +00:00
[gamecode] Rename MAX_PARMS to PR_MAXPARAMS
This commit is contained in:
parent
cfaf158ebc
commit
3c86660d4a
11 changed files with 21 additions and 21 deletions
|
@ -1205,7 +1205,7 @@ typedef struct {
|
|||
pr_int_t locals;
|
||||
pr_uint_t profile;
|
||||
pr_int_t numparms;
|
||||
dparmsize_t parm_size[MAX_PARMS];
|
||||
dparmsize_t parm_size[PR_MAX_PARAMS];
|
||||
dfunction_t *descriptor;
|
||||
builtin_proc func;
|
||||
} bfunction_t;
|
||||
|
@ -1896,8 +1896,8 @@ struct progs_s {
|
|||
/// \name parameter block
|
||||
///@{
|
||||
pr_type_t *pr_return;
|
||||
pr_type_t *pr_params[MAX_PARMS];
|
||||
pr_type_t *pr_real_params[MAX_PARMS];
|
||||
pr_type_t *pr_params[PR_MAX_PARAMS];
|
||||
pr_type_t *pr_real_params[PR_MAX_PARAMS];
|
||||
int pr_param_size; ///< covers both params and return
|
||||
int pr_param_alignment; ///< covers both params and return
|
||||
pr_type_t pr_return_buffer[32];///< for discarded return values
|
||||
|
|
|
@ -506,7 +506,7 @@ typedef struct dparmsize_s {
|
|||
|
||||
#define DEF_SAVEGLOBAL (1<<15)
|
||||
|
||||
#define MAX_PARMS 8
|
||||
#define PR_MAX_PARAMS 8
|
||||
|
||||
typedef struct dfunction_s {
|
||||
pr_int_t first_statement; // negative numbers are builtins
|
||||
|
@ -519,7 +519,7 @@ typedef struct dfunction_s {
|
|||
pr_string_t file; // source file defined in
|
||||
|
||||
pr_int_t numparms; // -ve is varargs (1s comp of real count)
|
||||
dparmsize_t parm_size[MAX_PARMS];
|
||||
dparmsize_t parm_size[PR_MAX_PARAMS];
|
||||
} dfunction_t;
|
||||
|
||||
typedef union pr_type_u {
|
||||
|
|
|
@ -1612,7 +1612,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents)
|
|||
opchar = fmt[3];
|
||||
parm_ind = fmt[2] - '0';
|
||||
fmt++; // P has one extra item
|
||||
if (parm_ind >= MAX_PARMS)
|
||||
if (parm_ind >= PR_MAX_PARAMS)
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ static void
|
|||
PR_EnterFunction (progs_t *pr, bfunction_t *f)
|
||||
{
|
||||
pr_int_t i;
|
||||
pr_type_t *dstParams[MAX_PARMS];
|
||||
pr_type_t *dstParams[PR_MAX_PARAMS];
|
||||
pr_ptr_t paramofs = 0;
|
||||
|
||||
if (pr->pr_trace && !pr->debug_handler) {
|
||||
|
@ -263,7 +263,7 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f)
|
|||
}
|
||||
dparmsize_t parmsize = { pr->pr_param_size, pr->pr_param_alignment };
|
||||
paramofs = align_offset (paramofs, parmsize );
|
||||
if (i < MAX_PARMS) {
|
||||
if (i < PR_MAX_PARAMS) {
|
||||
dstParams[i] = pr->pr_globals + paramofs;
|
||||
}
|
||||
for (; i < pr->pr_argc; i++) {
|
||||
|
@ -303,7 +303,7 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f)
|
|||
copy_args = pr->pr_argc - i;
|
||||
argc->int_var = copy_args;
|
||||
argv->int_var = dstParams[i] - pr->pr_globals;
|
||||
if (i < MAX_PARMS) {
|
||||
if (i < PR_MAX_PARAMS) {
|
||||
memcpy (dstParams[i], pr->pr_params[i],
|
||||
(copy_args * pr->pr_param_size) * sizeof (pr_type_t));
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ PR_ResolveGlobals (progs_t *pr)
|
|||
if (!(def = PR_FindGlobal (pr, sym = ".return")))
|
||||
goto error;
|
||||
pr->pr_return = &pr->pr_globals[def->ofs];
|
||||
for (i = 0; i < MAX_PARMS; i++) {
|
||||
for (i = 0; i < PR_MAX_PARAMS; i++) {
|
||||
param_n[sizeof (param_str) - 2] = i + '0';
|
||||
if (!(def = PR_FindGlobal (pr, sym = param_n)))
|
||||
goto error;
|
||||
|
|
|
@ -1508,7 +1508,7 @@ is_vector_parameter_store (progs_t *pr, dstatement_t *st,
|
|||
return 0;
|
||||
if (operand != st->a)
|
||||
return 0;
|
||||
for (i = 0; i < MAX_PARMS; i++)
|
||||
for (i = 0; i < PR_MAX_PARAMS; i++)
|
||||
if (st->b == pr->pr_params[i] - pr->pr_globals)
|
||||
return 1;
|
||||
return 0;
|
||||
|
|
|
@ -1412,7 +1412,7 @@ rua_obj_msg_sendv (progs_t *pr)
|
|||
int count = args->count;
|
||||
pr_type_t *params = G_GPOINTER (pr, args->list);
|
||||
|
||||
if (count < 2 || count > MAX_PARMS) {
|
||||
if (count < 2 || count > PR_MAX_PARAMS) {
|
||||
PR_RunError (pr, "bad args count in obj_msg_sendv: %d", count);
|
||||
}
|
||||
if (pr_boundscheck->int_val) {
|
||||
|
|
|
@ -1115,7 +1115,7 @@ PF_WriteBytes (progs_t *pr)
|
|||
{
|
||||
int i, p;
|
||||
int count = pr->pr_argc - 1;
|
||||
byte buf[MAX_PARMS];
|
||||
byte buf[PR_MAX_PARAMS];
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
p = P_FLOAT (pr, i + 1);
|
||||
|
|
|
@ -2029,8 +2029,8 @@ build_function_call (expr_t *fexpr, const type_t *ftype, expr_t *params)
|
|||
int arg_count = 0, parm_count = 0;
|
||||
int i;
|
||||
expr_t *args = 0, **a = &args;
|
||||
type_t *arg_types[MAX_PARMS];
|
||||
expr_t *arg_exprs[MAX_PARMS][2];
|
||||
type_t *arg_types[PR_MAX_PARAMS];
|
||||
expr_t *arg_exprs[PR_MAX_PARAMS][2];
|
||||
int arg_expr_count = 0;
|
||||
expr_t *assign;
|
||||
expr_t *call;
|
||||
|
@ -2042,8 +2042,8 @@ build_function_call (expr_t *fexpr, const type_t *ftype, expr_t *params)
|
|||
arg_count++;
|
||||
}
|
||||
|
||||
if (arg_count > MAX_PARMS) {
|
||||
return error (fexpr, "more than %d parameters", MAX_PARMS);
|
||||
if (arg_count > PR_MAX_PARAMS) {
|
||||
return error (fexpr, "more than %d parameters", PR_MAX_PARAMS);
|
||||
}
|
||||
if (ftype->t.func.num_params < -1) {
|
||||
if (-arg_count > ftype->t.func.num_params + 1) {
|
||||
|
|
|
@ -536,7 +536,7 @@ build_scope (symbol_t *fsym, symtab_t *parent)
|
|||
}
|
||||
|
||||
if (args) {
|
||||
while (i < MAX_PARMS) {
|
||||
while (i < PR_MAX_PARAMS) {
|
||||
param = new_symbol_type (va (0, ".par%d", i), &type_param);
|
||||
initialize_def (param, 0, parameters->space, sc_param);
|
||||
i++;
|
||||
|
@ -636,7 +636,7 @@ static void
|
|||
build_function (symbol_t *fsym)
|
||||
{
|
||||
const type_t *func_type = fsym->s.func->type;
|
||||
if (func_type->t.func.num_params > MAX_PARMS) {
|
||||
if (func_type->t.func.num_params > PR_MAX_PARAMS) {
|
||||
error (0, "too many params");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -710,8 +710,8 @@ method_check_params (method_t *method, expr_t *args)
|
|||
for (count = 0, a = args; a; a = a->next)
|
||||
count++;
|
||||
|
||||
if (count > MAX_PARMS)
|
||||
return error (args, "more than %d parameters", MAX_PARMS);
|
||||
if (count > PR_MAX_PARAMS)
|
||||
return error (args, "more than %d parameters", PR_MAX_PARAMS);
|
||||
|
||||
if (mtype->t.func.num_params >= 0)
|
||||
param_count = mtype->t.func.num_params;
|
||||
|
|
Loading…
Reference in a new issue