mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
fix qfcc's incorrect allocation/initialization for pointers (eg, float [] foo)
This commit is contained in:
parent
938037c5ea
commit
ad6d847728
2 changed files with 8 additions and 5 deletions
|
@ -479,7 +479,6 @@ void () menu_init =
|
||||||
InputLine_SetWidth (lanConfig_port_il, 10);
|
InputLine_SetWidth (lanConfig_port_il, 10);
|
||||||
lanConfig_join_il = InputLine_Create (4, 24, ' ');
|
lanConfig_join_il = InputLine_Create (4, 24, ' ');
|
||||||
InputLine_SetWidth (lanConfig_join_il, 26);
|
InputLine_SetWidth (lanConfig_join_il, 26);
|
||||||
input_active = NIL; //FIXME def alloc bug in qfcc
|
|
||||||
switch (gametype ()) {
|
switch (gametype ()) {
|
||||||
case "netquake":
|
case "netquake":
|
||||||
do_single_player = 1;
|
do_single_player = 1;
|
||||||
|
|
|
@ -185,6 +185,7 @@ PR_GetDef (type_t *type, const char *name, def_t *scope, int *allocate)
|
||||||
d->used = 1; // always `used'
|
d->used = 1; // always `used'
|
||||||
d->parent = def;
|
d->parent = def;
|
||||||
} else if (type->aux_type->type == ev_pointer) {
|
} else if (type->aux_type->type == ev_pointer) {
|
||||||
|
//FIXME I don't think this is right for a field pointer
|
||||||
size = PR_GetTypeSize (type->aux_type->aux_type);
|
size = PR_GetTypeSize (type->aux_type->aux_type);
|
||||||
pr.size_fields += type->aux_type->num_parms * size;
|
pr.size_fields += type->aux_type->num_parms * size;
|
||||||
} else {
|
} else {
|
||||||
|
@ -194,21 +195,24 @@ PR_GetDef (type_t *type, const char *name, def_t *scope, int *allocate)
|
||||||
} else if (type->type == ev_pointer) {
|
} else if (type->type == ev_pointer) {
|
||||||
dstatement_t *st;
|
dstatement_t *st;
|
||||||
statref_t *ref;
|
statref_t *ref;
|
||||||
|
int ofs;
|
||||||
|
|
||||||
if (pr_scope) {
|
if (pr_scope) {
|
||||||
st = (dstatement_t *) &G_INT (def->ofs);
|
st = (dstatement_t *) &G_INT (def->ofs);
|
||||||
ref = PR_NewStatref (st, 4);
|
ref = PR_NewStatref (st, 4);
|
||||||
ref->next = def->refs;
|
ref->next = def->refs;
|
||||||
def->refs = ref;
|
def->refs = ref;
|
||||||
G_INT (def->ofs) = 1;
|
ofs = 1;
|
||||||
} else {
|
} else {
|
||||||
G_INT (def->ofs) = *allocate;
|
ofs = *allocate;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = PR_GetTypeSize (type->aux_type);
|
size = PR_GetTypeSize (type->aux_type);
|
||||||
*allocate += type->num_parms * size;
|
if (type->num_parms) {
|
||||||
if (type->num_parms)
|
*allocate += type->num_parms * size;
|
||||||
def->initialized = def->constant = 1;
|
def->initialized = def->constant = 1;
|
||||||
|
G_INT (def->ofs) = ofs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return def;
|
return def;
|
||||||
|
|
Loading…
Reference in a new issue