mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[vulkan] Allow null extra items and symbols
Don't want to have to pass empty lists.
This commit is contained in:
parent
b10c8dc1a1
commit
acf828baa3
1 changed files with 9 additions and 5 deletions
|
@ -2224,12 +2224,16 @@ QFV_CreateSymtab (plitem_t *dict, const char *properties,
|
|||
int num_extra = 0;
|
||||
int num_syms = 0;
|
||||
|
||||
if (extra_items) {
|
||||
for (const char **e = extra_items; *e; e++) {
|
||||
if (PL_ObjectForKey (dict, *e)) {
|
||||
num_extra++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (extra_syms) {
|
||||
for (exprsym_t *sym = extra_syms; sym->name; sym++, num_syms++) { }
|
||||
}
|
||||
|
||||
int total_items = num_keys + num_extra;
|
||||
int total_syms = total_items + num_syms;
|
||||
|
@ -2249,7 +2253,7 @@ QFV_CreateSymtab (plitem_t *dict, const char *properties,
|
|||
};
|
||||
items[i] = PL_ObjectForKey (props, symtab->symbols[i].name);
|
||||
}
|
||||
for (int i = 0, j = 0; extra_items[i]; i++) {
|
||||
for (int i = 0, j = 0; num_extra && extra_items[i]; i++) {
|
||||
plitem_t *val = PL_ObjectForKey (dict, extra_items[i]);
|
||||
if (val) {
|
||||
symtab->symbols[num_keys + j] = (exprsym_t) {
|
||||
|
|
Loading…
Reference in a new issue