From df9d20019bed30c1b3866ea5a142353507011af3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Mon, 5 Sep 2011 15:54:11 -0700 Subject: [PATCH] Fixed calls to bitwise-ior using new, variadic bit-ior. --- src/gtk/fix-layout.scm | 16 ++++++++-------- src/gtk/gio.scm | 4 ++-- src/gtk/gtk-ev.scm | 10 +++++----- src/gtk/gtk.scm | 6 +++++- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/gtk/fix-layout.scm b/src/gtk/fix-layout.scm index 600b4fc9c..d16f89ed8 100644 --- a/src/gtk/fix-layout.scm +++ b/src/gtk/fix-layout.scm @@ -324,10 +324,10 @@ USA. (error-if-null parent-GdkWindow "Could not get parent:" widget) (C-call "gdk_window_new" main-GdkWindow parent-GdkWindow attr - (bitwise-ior (if x (C-enum "GDK_WA_X") 0) - (if y (C-enum "GDK_WA_Y") 0) - ;;(C-enum "GDK_WA_VISUAL") - (C-enum "GDK_WA_COLORMAP"))) + (bit-ior (if x (C-enum "GDK_WA_X") 0) + (if y (C-enum "GDK_WA_Y") 0) + ;;(C-enum "GDK_WA_VISUAL") + (C-enum "GDK_WA_COLORMAP"))) (error-if-null main-GdkWindow "Could not create main window:" widget) (C-call "gtk_widget_set_window" GtkWidget main-GdkWindow) (C-call "gdk_window_set_user_data" main-GdkWindow GtkWidget) @@ -734,10 +734,10 @@ USA. (define (set-drawing-extent! drawing rectangle) (let ((extent (fix-drawing-extent drawing))) (set-fix-rect! extent - (fix-rect-x rectangle) - (fix-rect-y rectangle) - (fix-rect-width rectangle) - (fix-rect-height rectangle)))) + (fix-rect-x rectangle) + (fix-rect-y rectangle) + (fix-rect-width rectangle) + (fix-rect-height rectangle)))) (define-class () diff --git a/src/gtk/gio.scm b/src/gtk/gio.scm index cd66164a3..8dded5a72 100644 --- a/src/gtk/gio.scm +++ b/src/gtk/gio.scm @@ -630,7 +630,7 @@ USA. setup-output))) (define (->gfile-create-flags flags) - (reduce-left bitwise-ior 0 (map! ->gfile-create-flag flags))) + (apply bit-ior (map! ->gfile-create-flag flags))) (define (->gfile-create-flag flag) (case flag @@ -1124,7 +1124,7 @@ USA. (define (->ask-password-flags flags) (define-integrable (cons-flags mask symbol rest) - (if (not (zero? (bitwise-and mask flags))) + (if (bit? flags mask) (cons symbol rest) rest)) (cons-flags diff --git a/src/gtk/gtk-ev.scm b/src/gtk/gtk-ev.scm index dd94e3e45..4ea34a337 100644 --- a/src/gtk/gtk-ev.scm +++ b/src/gtk/gtk-ev.scm @@ -89,14 +89,14 @@ USA. (C->= attr "GdkWindowAttr height" (fix-rect-height b))) (C->= attr "GdkWindowAttr wclass" (C-enum "GDK_INPUT_OUTPUT")) (C->= attr "GdkWindowAttr event_mask" - (bitwise-ior (C-call "gtk_widget_get_events" alien) - (C-enum "GDK_EXPOSURE_MASK"))) + (bit-ior (C-call "gtk_widget_get_events" alien) + (C-enum "GDK_EXPOSURE_MASK"))) (C-call "gtk_widget_get_parent_window" parent-GdkWindow alien) (error-if-null parent-GdkWindow "Could not get parent:" widget) (C-call "gdk_window_new" main-GdkWindow parent-GdkWindow attr - (bitwise-ior (C-enum "GDK_WA_X") (C-enum "GDK_WA_Y"))) + (bit-ior (C-enum "GDK_WA_X") (C-enum "GDK_WA_Y"))) (error-if-null main-GdkWindow "Could not create main window:" widget) (C->= alien "GtkWidget window" main-GdkWindow) (C-call "gdk_window_set_user_data" main-GdkWindow alien) @@ -114,8 +114,8 @@ USA. (C->= attr "GdkWindowAttr event_mask" (C-enum "GDK_ALL_EVENTS_MASK")) (C->= attr "GdkWindowAttr cursor" GdkCursor) (C-call "gdk_window_new" event-GdkWindow main-GdkWindow attr - (bitwise-ior (C-enum "GDK_WA_X") (C-enum "GDK_WA_Y") - (C-enum "GDK_WA_CURSOR"))) + (bit-ior (C-enum "GDK_WA_X") (C-enum "GDK_WA_Y") + (C-enum "GDK_WA_CURSOR"))) (error-if-null event-GdkWindow "Could not create event window:" widget) (C-call "gdk_window_set_user_data" event-GdkWindow alien) (C-call "gdk_window_show" event-GdkWindow) diff --git a/src/gtk/gtk.scm b/src/gtk/gtk.scm index 09c564fb3..0e36be7f4 100644 --- a/src/gtk/gtk.scm +++ b/src/gtk/gtk.scm @@ -65,4 +65,8 @@ USA. '()))))) (define-integrable (bit? int mask) - (not (int:zero? (bitwise-and int mask)))) \ No newline at end of file + (not (int:zero? (bitwise-and int mask)))) + +(declare (integrate-operator bit-ior)) +(define (bit-ior . ints) + (reduce bitwise-ior 0 ints)) \ No newline at end of file -- 2.25.1