racket/gui: correct some casts in GUI bindings

This commit is contained in:
Matthew Flatt 2012-01-23 07:37:17 -07:00
parent 877d528ed3
commit 01dce00271
4 changed files with 6 additions and 5 deletions

View File

@ -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))

View File

@ -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))

View File

@ -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?

View File

@ -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)))