mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 17:12:15 +00:00
[qfcc] Fix missing protocol method lists
The problem was an erroneous assumption that the methods had to be defined. Any class implementing a protocol must implement (and thus define) the methods, but a protocol declaration cannot: it merely declares the methods, and it's entirely possible for a module to see only the protocol definition and not any classes implementing the protocol.
This commit is contained in:
parent
b6b7f9675f
commit
8021613b79
1 changed files with 6 additions and 4 deletions
|
@ -511,9 +511,11 @@ emit_method_list_item (def_t *def, void *data, int index)
|
||||||
method_t *m;
|
method_t *m;
|
||||||
pr_method_description_t *desc;
|
pr_method_description_t *desc;
|
||||||
|
|
||||||
if (def->type != &type_obj_method_description)
|
if (!is_array (def->type)
|
||||||
internal_error (0, "%s: expected method_description def",
|
|| def->type->t.array.type != &type_obj_method_description) {
|
||||||
|
internal_error (0, "%s: expected array of method_description def",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
|
}
|
||||||
if (index < 0 || index >= methods->count)
|
if (index < 0 || index >= methods->count)
|
||||||
internal_error (0, "%s: out of bounds index: %d %d",
|
internal_error (0, "%s: out of bounds index: %d %d",
|
||||||
__FUNCTION__, index, methods->count);
|
__FUNCTION__, index, methods->count);
|
||||||
|
@ -521,7 +523,7 @@ emit_method_list_item (def_t *def, void *data, int index)
|
||||||
desc = D_POINTER (pr_method_description_t, def);
|
desc = D_POINTER (pr_method_description_t, def);
|
||||||
|
|
||||||
for (m = methods->head; m; m = m->next) {
|
for (m = methods->head; m; m = m->next) {
|
||||||
if (!m->instance != !methods->instance || !m->def)
|
if (!m->instance != !methods->instance)
|
||||||
continue;
|
continue;
|
||||||
if (!index--)
|
if (!index--)
|
||||||
break;
|
break;
|
||||||
|
@ -547,7 +549,7 @@ emit_method_descriptions (methodlist_t *methods, const char *name,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (count = 0, m = methods->head; m; m = m->next)
|
for (count = 0, m = methods->head; m; m = m->next)
|
||||||
if (!m->instance == !instance && m->def)
|
if (!m->instance == !instance)
|
||||||
count++;
|
count++;
|
||||||
if (!count)
|
if (!count)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue