mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
Rearrange class_message_response.
Even if an object doesn't seem to respond to a message, return the message so unrelated warnings or errors don't occur.
This commit is contained in:
parent
218424d0ae
commit
d33d062bd1
1 changed files with 8 additions and 10 deletions
|
@ -839,16 +839,7 @@ class_message_response (class_t *class, int class_msg, expr_t *sel)
|
|||
selector = get_selector (sel);
|
||||
if (!selector)
|
||||
return 0;
|
||||
if (class->type == &type_id) {
|
||||
m = find_method (selector->name);
|
||||
if (m)
|
||||
return m;
|
||||
//FIXME right option?
|
||||
if (options.warnings.interface_check)
|
||||
warning (sel, "could not find method for %c%s",
|
||||
class_msg ? '+' : '-', selector->name);
|
||||
return 0;
|
||||
} else {
|
||||
if (class->type != &type_id) {
|
||||
while (c) {
|
||||
for (cat = c->categories; cat; cat = cat->next) {
|
||||
for (m = cat->methods->head; m; m = m->next) {
|
||||
|
@ -871,6 +862,13 @@ class_message_response (class_t *class, int class_msg, expr_t *sel)
|
|||
warning (sel, "%s may not respond to %c%s", class->name,
|
||||
class_msg ? '+' : '-', selector->name);
|
||||
}
|
||||
m = find_method (selector->name);
|
||||
if (m)
|
||||
return m;
|
||||
//FIXME right option?
|
||||
if (options.warnings.interface_check)
|
||||
warning (sel, "could not find method for %c%s",
|
||||
class_msg ? '+' : '-', selector->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue