]> gitweb.factorcode.org Git - factor.git/commitdiff
io.ports: make read-step inline
authorJoe Groff <arcata@gmail.com>
Thu, 10 Nov 2011 03:59:46 +0000 (19:59 -0800)
committerJoe Groff <arcata@gmail.com>
Thu, 10 Nov 2011 03:59:46 +0000 (19:59 -0800)
basis/io/ports/ports.factor

index 68574af77b8e25648d62153891ff8e91b625ea40..55fb9c348eedd4d58c23ce724665815ff857fc7c 100644 (file)
@@ -46,15 +46,12 @@ M: input-port stream-read1
     dup check-disposed
     dup wait-to-read [ drop f ] [ buffer>> buffer-pop ] if ; inline
 
-! TYPED: read-step ( count: fixnum port: input-port -- count: fixnum ptr/f: c-ptr )
-: (read-step) ( count: fixnum port: input-port -- count: fixnum ptr/f: c-ptr )
+: read-step ( count port -- count ptr/f )
     {
         { [ over 0 = ] [ 2drop 0 f ] }
         { [ dup wait-to-read ] [ 2drop 0 f ] }
         [ buffer>> buffer-read-unsafe ]
-    } cond ;
-: read-step ( count port -- count ptr/f )
-    (read-step) { fixnum c-ptr } declare ; inline
+    } cond ; inline
 
 : prepare-read ( count stream -- count stream )
     dup check-disposed [ 0 max >fixnum ] dip ; inline