From 01dce002717564df1b0ba9da9e2179be420f7f9d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 23 Jan 2012 07:37:17 -0700 Subject: [PATCH] racket/gui: correct some casts in GUI bindings --- collects/mred/private/wx/cocoa/finfo.rkt | 4 ++-- collects/mred/private/wx/gtk/clipboard.rkt | 3 ++- collects/mred/private/wx/win32/list-box.rkt | 2 +- collects/mred/private/wx/win32/window.rkt | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/collects/mred/private/wx/cocoa/finfo.rkt b/collects/mred/private/wx/cocoa/finfo.rkt index e248e6b894..6211268512 100644 --- a/collects/mred/private/wx/cocoa/finfo.rkt +++ b/collects/mred/private/wx/cocoa/finfo.rkt @@ -119,7 +119,7 @@ (unless (path-string? path) (raise-type-error 'file-creator-and-type "path string" path)) (let ([info (let ([fs (path->fsref path)] - [v (cast (malloc 256) _pointer (_gcable _FSCatalogInfo-pointer))]) + [v (cast (malloc 256) _gcpointer (_gcable _FSCatalogInfo-pointer))]) (get-info v fs path) (FSCatalogInfo-finderInfo v))]) (values (int->str (FileInfo-fileCreator info)) @@ -132,7 +132,7 @@ (unless (and (bytes? type) (= 4 (bytes-length type))) (raise-type-error 'file-creator-and-type "bytes string of length 4" type)) (let ([fs (path->fsref path)] - [v (cast (malloc 256) _pointer (_gcable _FSCatalogInfo-pointer))]) + [v (cast (malloc 256) _gcpointer (_gcable _FSCatalogInfo-pointer))]) (get-info v fs path) (let ([info (FSCatalogInfo-finderInfo v)]) (set-FileInfo-fileCreator! info (str->int creator)) diff --git a/collects/mred/private/wx/gtk/clipboard.rkt b/collects/mred/private/wx/gtk/clipboard.rkt index eb64473f5a..50c9c30bd9 100644 --- a/collects/mred/private/wx/gtk/clipboard.rkt +++ b/collects/mred/private/wx/gtk/clipboard.rkt @@ -178,7 +178,8 @@ [targets (malloc _GtkTargetEntry (length types))]) (for/fold ([offset 0]) ([str (in-list types)] [i (in-naturals)]) - (let ([t (cast (ptr-add targets i _GtkTargetEntry) _pointer _GtkTargetEntry-pointer)]) + (let ([t (ptr-add targets i _GtkTargetEntry)]) + (cpointer-push-tag! t 'GtkTargetEntry) (set-GtkTargetEntry-target! t (ptr-add target-strings offset)) (set-GtkTargetEntry-flags! t 0) (set-GtkTargetEntry-info! t i)) diff --git a/collects/mred/private/wx/win32/list-box.rkt b/collects/mred/private/wx/win32/list-box.rkt index b87aef84e8..a2d88ff038 100644 --- a/collects/mred/private/wx/win32/list-box.rkt +++ b/collects/mred/private/wx/win32/list-box.rkt @@ -353,7 +353,7 @@ (let* ([count num-columns] [a (malloc _int count)]) (SendMessageW/ptr hwnd LVM_GETCOLUMNORDERARRAY count a) - (cast a _pointer (_list o _int count))))) + (cast a _gcpointer (_list o _int count))))) (define/public (set-column-label col s) (unless single-column? diff --git a/collects/mred/private/wx/win32/window.rkt b/collects/mred/private/wx/win32/window.rkt index ea9e45a5f4..6843c356ef 100644 --- a/collects/mred/private/wx/win32/window.rkt +++ b/collects/mred/private/wx/win32/window.rkt @@ -444,7 +444,7 @@ (let* ([len (DragQueryFileW hdrop i #f 0)] [b (malloc (add1 len) _int16)]) (DragQueryFileW hdrop i b (add1 len)) - (let ([s (cast b _pointer _string/utf-16)]) + (let ([s (cast b _gcpointer _string/utf-16)]) (queue-window-event this (lambda () (on-drop-file (string->path s))))))) (DragFinish hdrop)))