[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:
Bill Currie 2022-02-05 19:16:06 +09:00
parent 6f4bb0df2c
commit ab8692bd96
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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