From 3e9977c272debe36c27eeb9c8785a9123e9745fd Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 19 Mar 2020 15:53:20 +0900 Subject: [PATCH] [qwaq] Give up on pass-by-reference for now It's too much hassle to ensure the passed variable isn't a local. It's just not worth the grief right now. --- ruamoko/qwaq/qwaq-rect.h | 3 +-- ruamoko/qwaq/qwaq-rect.r | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ruamoko/qwaq/qwaq-rect.h b/ruamoko/qwaq/qwaq-rect.h index 3278afd14..2ab79788e 100644 --- a/ruamoko/qwaq/qwaq-rect.h +++ b/ruamoko/qwaq/qwaq-rect.h @@ -21,8 +21,7 @@ typedef struct Rect_s { @extern Point makePoint (int x, int y); @extern Extent makeExtent (int width, int height); @extern Extent mergeExtents (Extent a, Extent b); -//XXX will not work if point or rect point to a local variabl -@extern int rectContainsPoint (Rect *rect, Point *point); +@extern int rectContainsPoint (Rect rect, Point point); @extern Rect clipRect (Rect clipRect, Rect rect); #endif diff --git a/ruamoko/qwaq/qwaq-rect.r b/ruamoko/qwaq/qwaq-rect.r index 64048ca0b..c2677decc 100644 --- a/ruamoko/qwaq/qwaq-rect.r +++ b/ruamoko/qwaq/qwaq-rect.r @@ -46,7 +46,7 @@ Extent mergeExtents (Extent a, Extent b) } int -rectContainsPoint (Rect *rect, Point *point) +rectContainsPoint (Rect rect, Point point) { return ((point.x >= rect.offset.x && point.x < rect.offset.x + rect.extent.width)