]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/iokit/iokit.factor
Updating code to use with-out-parameters
[factor.git] / basis / iokit / iokit.factor
index 577c9e127300f9f124143a93e2375572d587987c..5720fc5997896a1ed9066686d8fa0e5979da9611 100644 (file)
@@ -1,4 +1,4 @@
-USING: alien.syntax alien.c-types core-foundation
+USING: alien.syntax alien.c-types alien.data core-foundation
 core-foundation.bundles core-foundation.dictionaries system
 combinators kernel sequences io accessors unix.types ;
 IN: iokit
@@ -131,12 +131,11 @@ TUPLE: mach-error error-code error-string ;
     dup KERN_SUCCESS = [ drop ] [ <mach-error> throw ] if ;
 
 : master-port ( -- port )
-    MACH_PORT_NULL 0 <uint> [ IOMasterPort mach-error ] keep *uint ;
+    MACH_PORT_NULL { uint } [ IOMasterPort mach-error ] [ ] with-out-parameters ;
 
 : io-services-matching-dictionary ( nsdictionary -- iterator )
-    master-port swap 0 <uint>
-    [ IOServiceGetMatchingServices mach-error ] keep
-    *uint ;
+    master-port swap
+    { uint } [ IOServiceGetMatchingServices mach-error ] [ ] with-out-parameters ;
 
 : io-services-matching-service ( service -- iterator )
     IOServiceMatching io-services-matching-dictionary ;