mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +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);
|
selector = get_selector (sel);
|
||||||
if (!selector)
|
if (!selector)
|
||||||
return 0;
|
return 0;
|
||||||
if (class->type == &type_id) {
|
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 {
|
|
||||||
while (c) {
|
while (c) {
|
||||||
for (cat = c->categories; cat; cat = cat->next) {
|
for (cat = c->categories; cat; cat = cat->next) {
|
||||||
for (m = cat->methods->head; m; m = m->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,
|
warning (sel, "%s may not respond to %c%s", class->name,
|
||||||
class_msg ? '+' : '-', selector->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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue