From ada7af2ab3e30f51e21eaf9c7646602befd6f02b Mon Sep 17 00:00:00 2001 From: frese Date: Thu, 23 Oct 2003 12:38:33 +0000 Subject: [PATCH] - fixed Iso-C problems - minor bugs fixed. --- c/xlib/region.c | 22 ++++++++++++---------- scheme/xlib/region.scm | 2 +- scheme/xlib/xlib-interfaces.scm | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/c/xlib/region.c b/c/xlib/region.c index 6e0ba17..f423030 100644 --- a/c/xlib/region.c +++ b/c/xlib/region.c @@ -1,7 +1,7 @@ #include "xlib.h" -#define scx_extract_region(x) (Region)s48_extract_pointer(x) -#define scx_enter_region(r) s48_enter_pointer(r) +#define scx_extract_region(x) (Region)S48_EXTRACT_POINTER(x) +#define scx_enter_region(r) S48_ENTER_POINTER(r) /*** create or destroy regions *************************************/ @@ -27,22 +27,24 @@ s48_value scx_Empty_Region(s48_value r) { } s48_value scx_Equal_Region(s48_value r1, s48_value r2) { + Bool res; S48_DECLARE_GC_PROTECT_2(r1, r2); - Bool res = XEqualRegion(scx_extract_region(r1), - scx_extract_region(r2)); + res = XEqualRegion(scx_extract_region(r1), + scx_extract_region(r2)); S48_GC_RETURN(S48_ENTER_BOOLEAN(res)); } s48_value scx_Point_In_Region(s48_value r, s48_value x, s48_value y) { + Bool res; S48_DECLARE_GC_PROTECT_3(r, x, y); - Bool res = XPointInRegion(scx_extract_region(r), - s48_extract_integer(x), - s48_extract_integer(y)); + res = XPointInRegion(scx_extract_region(r), + s48_extract_integer(x), + s48_extract_integer(y)); S48_GC_RETURN(S48_ENTER_BOOLEAN(res)); } -extern s48_value scx_rect_in_region_type_binding; -extern s48_value scx_rect_in_region_types_binding; +s48_value scx_rect_in_region_type_binding = S48_FALSE; +s48_value scx_rect_in_region_types_binding = S48_FALSE; #define scx_extract_rect_in_region_type(x) \ S48_EXTRACT_ENUM(x, scx_rect_in_region_type_binding) #define scx_enter_rect_in_region_type(x) \ @@ -134,7 +136,7 @@ s48_value scx_Polygon_Region(s48_value points, s48_value fill_rule) { points = S48_CDR(points); } r = XPolygonRegion(ps, n, scx_extract_fill_rule(fill_rule)); - S48_RETURN(scx_enter_region(r)); + S48_GC_RETURN(scx_enter_region(r)); } s48_value scx_Clip_Box(s48_value r) { diff --git a/scheme/xlib/region.scm b/scheme/xlib/region.scm index 50c2f52..b1fdd71 100644 --- a/scheme/xlib/region.scm +++ b/scheme/xlib/region.scm @@ -18,7 +18,7 @@ (define-enumerated-type rect-in-region-type :rect-in-region-type rect-in-region-type? rect-in-region-types rect-in-region-type-name rect-in-region-type-index - (rectangle-in rectangle-out rectangle-part)) + (out in part)) (define-exported-binding "scx-rect-in-region-type" :rect-in-region-type) (define-exported-binding "scx-rect-in-region-types" rect-in-region-types) diff --git a/scheme/xlib/xlib-interfaces.scm b/scheme/xlib/xlib-interfaces.scm index 4536c93..50734d1 100644 --- a/scheme/xlib/xlib-interfaces.scm +++ b/scheme/xlib/xlib-interfaces.scm @@ -799,11 +799,11 @@ ;; region.scm ***************************************************** create-region set-region destroy-region empty-region? equal-region? point-in-region? - ((rectangle-in rectangle-out rectangle-part) :enumeration) + (rect-in-region-type :enumeration) rect-in-region? intersect-region! intersect-region union-region! union-region union-rect-with-region! union-rect-with-region subtract-region! subtract-region xor-region! xor-region - offset-region! shrink-region + offset-region! shrink-region! polygon-region clip-box ;; atom.scm *******************************************************