From 03489f9c56f27c6377aae87b48bd4bd951d332db Mon Sep 17 00:00:00 2001 From: eknauel Date: Thu, 27 May 2004 08:39:03 +0000 Subject: [PATCH] Fixed scx_Get_Gc_Values(diplay, gc, values): Don't side effect the values argument, it's also (later) used by scx_extract_gc_value() which expects it to be unmodified. This patch makes selectors on graphic contexts usable. --- c/xlib/gcontext.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/c/xlib/gcontext.c b/c/xlib/gcontext.c index eb347f0..2c6b1c0 100644 --- a/c/xlib/gcontext.c +++ b/c/xlib/gcontext.c @@ -280,10 +280,12 @@ s48_value scx_Change_Gc(s48_value display, s48_value gc, s48_value values) { s48_value scx_Get_Gc_Values(s48_value display, s48_value gc, s48_value values) { unsigned long mask = 0; + s48_value i; XGCValues GCV; - S48_DECLARE_GC_PROTECT_3(display, gc, values); - for (; values != S48_NULL; values = S48_CDR(values)) - mask |= (1L << scx_extract_gc_value(S48_CAR(values))); + S48_DECLARE_GC_PROTECT_4(display, gc, values, i); + + for (i = values; i != S48_NULL; i = S48_CDR(i)) + mask |= (1L << scx_extract_gc_value(S48_CAR(i))); if (!XGetGCValues(scx_extract_display(display), scx_extract_gc(gc),