mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 12:31:10 +00:00
[qwaq] Allow return values through forwarded messages
This was easy to achieve in v6p progs because all return values passed through .return and thus could not be lost. However, Ruamoko progs use a return pointer which can wind up pointed into the void (the return buffer) and thus cause the return value to be lost. Using @return on obj_msg_sendv bounces the return pointer through to the called function. In addition, nil is returned when the forwarding target is nil.
This commit is contained in:
parent
6f4bb0df2c
commit
ab8692bd96
2 changed files with 4 additions and 4 deletions
|
@ -10,9 +10,9 @@
|
|||
- (void) forward: (SEL) sel : (@va_list) args
|
||||
{
|
||||
if (!view) {
|
||||
return;
|
||||
@return nil;
|
||||
}
|
||||
obj_msg_sendv (view, sel, args);
|
||||
@return obj_msg_sendv (view, sel, args);
|
||||
}
|
||||
|
||||
-initWithView:(View *) view
|
||||
|
|
|
@ -264,12 +264,12 @@ updateScreenCursor (View *view)
|
|||
- (void) forward: (SEL) sel : (@va_list) args
|
||||
{
|
||||
if (!textContext) {
|
||||
return;
|
||||
@return nil;
|
||||
}
|
||||
if (!__obj_responds_to (textContext, sel)) {
|
||||
[self error: "no implementation for %s", sel_get_name (sel)];
|
||||
}
|
||||
obj_msg_sendv (textContext, sel, args);
|
||||
@return obj_msg_sendv (textContext, sel, args);
|
||||
}
|
||||
|
||||
- (void) refresh
|
||||
|
|
Loading…
Reference in a new issue