]> gitweb.factorcode.org Git - factor.git/commitdiff
Removing now-redundant underlying>> calls
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 6 Feb 2009 10:37:28 +0000 (04:37 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 6 Feb 2009 10:37:28 +0000 (04:37 -0600)
20 files changed:
basis/cocoa/messages/messages.factor
basis/cocoa/views/views.factor
basis/compiler/tests/alien.factor
basis/db/postgresql/lib/lib.factor
basis/io/backend/unix/multiplexers/epoll/epoll.factor
basis/io/backend/unix/multiplexers/kqueue/kqueue.factor
basis/io/backend/unix/multiplexers/select/select.factor
basis/io/launcher/windows/windows.factor
basis/io/pipes/unix/unix.factor
basis/libc/libc.factor
basis/opengl/opengl.factor
basis/opengl/shaders/shaders.factor
basis/specialized-arrays/specialized-arrays-tests.factor
basis/struct-arrays/struct-arrays-tests.factor
basis/unix/utilities/utilities.factor
basis/windows/com/wrapper/wrapper.factor
basis/windows/dinput/constants/constants.factor
basis/x11/clipboard/clipboard.factor
basis/x11/glx/glx.factor
basis/x11/xim/xim.factor

index ebe98a2df1f26bb8c96976b2580620a3f1c94464..a0b0e89a0d97952070d2748f54d2e7da3b4cb01b 100644 (file)
@@ -202,7 +202,7 @@ assoc-union alien>objc-types set-global
     [ 0 <uint> [ class_copyMethodList ] keep *uint ] dip
     over 0 = [ 3drop ] [
         [ <direct-void*-array> ] dip
-        [ each ] [ drop underlying>> (free) ] 2bi
+        [ each ] [ drop (free) ] 2bi
     ] if ; inline
 
 : register-objc-methods ( class -- )
index 03cafd0a0a895bd414a1ce9d57459d6946ca6440..e74e9122023123691cfdaea4c42ba3ef2d04eb87 100644 (file)
@@ -68,7 +68,7 @@ PRIVATE>
             NSOpenGLPFASamples , 8 ,
         ] when
         0 ,
-    ] int-array{ } make underlying>>
+    ] int-array{ } make
     -> initWithAttributes:
     -> autorelease ;
 
index b1a9853d553fc52e713298ff288f8b0de6f5ffa8..b9c62f1429708f65dd769188ad5ba73de2cf1ba9 100644 (file)
@@ -198,8 +198,8 @@ FUNCTION: int ffi_test_12 int a int b rect c int d int e int f ;
 FUNCTION: float ffi_test_23 ( float[3] x, float[3] y ) ;
 
 [ 32.0 ] [
-    { 1.0 2.0 3.0 } >float-array underlying>>
-    { 4.0 5.0 6.0 } >float-array underlying>>
+    { 1.0 2.0 3.0 } >float-array
+    { 4.0 5.0 6.0 } >float-array
     ffi_test_23
 ] unit-test
 
index 19cf5c5002f91161f0df6afb2c681d0d75ee3259..05114a4deb8128d31a7596011b4b20b623ebecbe 100644 (file)
@@ -65,7 +65,7 @@ M: postgresql-result-null summary ( obj -- str )
     } case ;
 
 : param-types ( statement -- seq )
-    in-params>> [ type>> type>oid ] uint-array{ } map-as underlying>> ;
+    in-params>> [ type>> type>oid ] uint-array{ } map-as ;
 
 : malloc-byte-array/length ( byte-array -- alien length )
     [ malloc-byte-array &free ] [ length ] bi ;
@@ -91,11 +91,11 @@ M: postgresql-result-null summary ( obj -- str )
     ] 2map flip [
         f f
     ] [
-        first2 [ >void*-array underlying>> ] [ >uint-array underlying>> ] bi*
+        first2 [ >void*-array ] [ >uint-array ] bi*
     ] if-empty ;
 
 : param-formats ( statement -- seq )
-    in-params>> [ type>> type>param-format ] uint-array{ } map-as underlying>> ;
+    in-params>> [ type>> type>param-format ] uint-array{ } map-as ;
 
 : do-postgresql-bound-statement ( statement -- res )
     [
index a91f62f1df4c2bcf32fd2ff3cfdfbaef5bf2dcdc..e1428fee4d09b52f84df14cabf7e766e7771c44a 100644 (file)
@@ -51,7 +51,7 @@ M: epoll-mx remove-output-callbacks ( fd mx -- seq )
     ] [ 2drop f ] if ;
 
 : wait-event ( mx us -- n )
-    [ [ fd>> ] [ events>> ] bi [ underlying>> ] [ length ] bi ] [ 1000 /i ] bi*
+    [ [ fd>> ] [ events>> ] bi dup length ] [ 1000 /i ] bi*
     epoll_wait multiplexer-error ;
 
 : handle-event ( event mx -- )
index 2a6648981b04419044535e803d540c5282ed5b9b..7bd157136a5daa682cd7aa60d182ec1557a2fad1 100644 (file)
@@ -59,7 +59,7 @@ M: kqueue-mx remove-output-callbacks ( fd mx -- seq )
 : wait-kevent ( mx timespec -- n )
     [
         [ fd>> f 0 ]
-        [ events>> [ underlying>> ] [ length ] bi ] bi
+        [ events>> dup length ] bi
     ] dip kevent multiplexer-error ;
 
 : handle-kevent ( mx kevent -- )
index c62101e478125d2d2777f1b0cb8f9a8605b1e55b..7d0acb4140a3f8d0ceeaba0542febb14d22d3028 100644 (file)
@@ -44,8 +44,8 @@ TUPLE: select-mx < mx read-fdset write-fdset ;
 
 : init-fdsets ( mx -- nfds read write except )
     [ num-fds ]
-    [ read-fdset/tasks [ init-fdset ] [ underlying>> ] bi ]
-    [ write-fdset/tasks [ init-fdset ] [ underlying>> ] bi ] tri
+    [ read-fdset/tasks [ init-fdset ] keep ]
+    [ write-fdset/tasks [ init-fdset ] keep ] tri
     f ;
 
 M:: select-mx wait-for-events ( us mx -- )
index 0497754aa226ffe8827a19ee5a30154df8241f8d..7de6c25a135fb3b8de86994167ceb0817f59910c 100755 (executable)
@@ -103,7 +103,7 @@ TUPLE: CreateProcess-args
             over get-environment
             [ swap % "=" % % "\0" % ] assoc-each
             "\0" %
-        ] ushort-array{ } make underlying>>
+        ] ushort-array{ } make
         >>lpEnvironment
     ] when ;
 
@@ -158,7 +158,7 @@ M: windows kill-process* ( handle -- )
 M: windows wait-for-processes ( -- ? )
     processes get keys dup
     [ handle>> PROCESS_INFORMATION-hProcess ] void*-array{ } map-as
-    [ length ] [ underlying>> ] bi 0 0
+    [ length ] keep 0 0
     WaitForMultipleObjects
     dup HEX: ffffffff = [ win32-error ] when
     dup WAIT_TIMEOUT = [ 2drop t ] [ swap nth process-exited f ] if ;
index 6a0015084b63851e1e985412b75914dd82b11f0b..f94733ca560021b8ae3f962bd84afe2bd8820f36 100644 (file)
@@ -7,5 +7,5 @@ QUALIFIED: io.pipes
 
 M: unix io.pipes:(pipe) ( -- pair )
     2 <int-array>
-    [ underlying>> pipe io-error ]
+    [ pipe io-error ]
     [ first2 [ <fd> init-fd ] bi@ io.pipes:pipe boa ] bi ;
index c4d351e6a0fea9436c29bb0d7c4bd0a454b47774..1e751833a22c759e3e3d0b9706032f260182ed3b 100644 (file)
@@ -75,14 +75,14 @@ PRIVATE>
     dup add-malloc ;
 
 : realloc ( alien size -- newalien )
+    [ >c-ptr ] dip
     over malloc-exists? [ realloc-error ] unless
     dupd (realloc) check-ptr
     swap delete-malloc
     dup add-malloc ;
 
 : free ( alien -- )
-    dup delete-malloc
-    (free) ;
+    >c-ptr [ delete-malloc ] [ (free) ] bi ;
 
 : memcpy ( dst src size -- )
     "void" "libc" "memcpy" { "void*" "void*" "ulong" } alien-invoke ;
index f5868ee7a13ee0732ece4bfd9103cc16fe83b198..6d9ac95965767fbe5cb5245b78394f1919da6401 100644 (file)
@@ -53,16 +53,16 @@ MACRO: all-enabled-client-state ( seq quot -- )
     glMatrixMode glPopMatrix ; inline
 
 : gl-material ( face pname params -- )
-    float-array{ } like underlying>> glMaterialfv ;
+    float-array{ } like glMaterialfv ;
 
 : gl-vertex-pointer ( seq -- )
-    [ 2 GL_FLOAT 0 ] dip underlying>> glVertexPointer ; inline
+    [ 2 GL_FLOAT 0 ] dip glVertexPointer ; inline
 
 : gl-color-pointer ( seq -- )
-    [ 4 GL_FLOAT 0 ] dip underlying>> glColorPointer ; inline
+    [ 4 GL_FLOAT 0 ] dip glColorPointer ; inline
 
 : gl-texture-coord-pointer ( seq -- )
-    [ 2 GL_FLOAT 0 ] dip underlying>> glTexCoordPointer ; inline
+    [ 2 GL_FLOAT 0 ] dip glTexCoordPointer ; inline
 
 : line-vertices ( a b -- )
     [ first2 [ 0.5 + ] bi@ ] bi@ 4 float-array{ } nsequence
@@ -177,7 +177,7 @@ MACRO: all-enabled-client-state ( seq quot -- )
     glActiveTexture swap glBindTexture gl-error ;
 
 : (set-draw-buffers) ( buffers -- )
-    [ length ] [ >uint-array underlying>> ] bi glDrawBuffers ;
+    [ length ] [ >uint-array ] bi glDrawBuffers ;
 
 MACRO: set-draw-buffers ( buffers -- )
     words>values [ (set-draw-buffers) ] curry ;
index eb5bbb0ee857ca983b7a92298ca602de0d3128a0..a77d29da2f69704d22f15266e68f25418b50eb92 100755 (executable)
@@ -96,7 +96,7 @@ PREDICATE: fragment-shader < gl-shader (fragment-shader?) ;
     dup gl-program-shaders-length
     0 <int>
     over <uint-array>
-    [ underlying>> glGetAttachedShaders ] keep ;
+    [ glGetAttachedShaders ] keep ;
 
 : delete-gl-program-only ( program -- )
     glDeleteProgram ; inline
index 1ca041191e82a799339239db0b12848123764d09..73e719b806f5d45beb2bf5a5635c04c81b1eb4a9 100644 (file)
@@ -1,7 +1,8 @@
 IN: specialized-arrays.tests
 USING: tools.test specialized-arrays sequences
 specialized-arrays.int specialized-arrays.bool
-specialized-arrays.ushort alien.c-types accessors kernel ;
+specialized-arrays.ushort alien.c-types accessors kernel
+specialized-arrays.direct.int arrays ;
 
 [ t ] [ { 1 2 3 } >int-array int-array? ] unit-test
 
@@ -16,3 +17,7 @@ specialized-arrays.ushort alien.c-types accessors kernel ;
 ] unit-test
 
 [ B{ 210 4 1 } byte-array>ushort-array ] must-fail
+
+[ { 3 1 3 3 7 } ] [
+    int-array{ 3 1 3 3 7 } malloc-byte-array 5 <direct-int-array> >array
+] unit-test
\ No newline at end of file
index 6f77e66cd2ac2ca5179fdbeaabfc63f5211d0014..a8ce98888cd91d91247d2b306d7ba7d9d1fc2ec9 100755 (executable)
@@ -22,7 +22,7 @@ C-STRUCT: test-struct
 [ 5/4 ] [
     [
         2 "test-struct" malloc-struct-array
-        dup underlying>> &free drop
+        dup &free drop
         1 2 make-point over set-first
         3 4 make-point over set-second
         0 [ [ test-struct-x ] [ test-struct-y ] bi / + ] reduce
@@ -34,6 +34,6 @@ C-STRUCT: test-struct
 [ ] [
     [
         10 "test-struct" malloc-struct-array
-        underlying>> &free drop
+        &free drop
     ] with-destructors
 ] unit-test
\ No newline at end of file
index e2f780cd1346cdd2c5ed4b10cc46b816103e4f01..29b137e3deb74c0c487d45e09d9b42eafc3cf39d 100644 (file)
@@ -16,5 +16,5 @@ IN: unix.utilities
     '[ [ advance ] [ *void* _ alien>string ] bi ]
     [ ] produce nip ;
 
-: strings>alien ( strings encoding -- alien )
-    '[ _ malloc-string ] void*-array{ } map-as f suffix underlying>> ;
+: strings>alien ( strings encoding -- array )
+    '[ _ malloc-string ] void*-array{ } map-as f suffix ;
index 813d8315ac07f0a893c220e66e5e75fb49f37e6c..c86cde23d9afcb9b65ad5d77716e8311f8953794 100755 (executable)
@@ -132,7 +132,7 @@ unless
     [ [ 1 ] 2dip set-alien-unsigned-4 ] [ drop ] 2bi ;
 
 : (callbacks>vtbl) ( callbacks -- vtbl )
-    [ execute ] void*-array{ } map-as underlying>> malloc-byte-array ;
+    [ execute ] void*-array{ } map-as malloc-byte-array ;
 : (callbacks>vtbls) ( callbacks -- vtbls )
     [ (callbacks>vtbl) ] map ;
 
index 0e9a03f0759d46ebc96b709d39ef63d60c7fd720..314fb167e3172520fb247762c3d8aa75879f1b98 100755 (executable)
@@ -59,7 +59,7 @@ SYMBOLS:
             struct args <DIOBJECTDATAFORMAT>
             i alien set-nth
         ] each-index
-        alien underlying>>
+        alien
     ] ;
 
 : (DIDATAFORMAT) ( dwSize dwObjSize dwFlags dwDataSize dwNumObjs rgodf alien -- alien )
index d3fe0a84477a147535b58cd332a62b464a9539cb..8375636a72e64dc4d6ba0f2cff3ea89b207e2e3b 100644 (file)
@@ -51,7 +51,7 @@ TUPLE: x-clipboard atom contents ;
     "TARGETS" x-atom 32 PropModeReplace
     {
         "UTF8_STRING" "STRING" "TARGETS" "TIMESTAMP"
-    } [ x-atom ] int-array{ } map-as underlying>>
+    } [ x-atom ] int-array{ } map-as
     4 XChangeProperty drop ;
 
 : set-timestamp-prop ( evt -- )
index e0b786ce7d586792a74d53f890c160aa8e484cb0..11473d6e83e6e84558c75ff7a46ee2e5cf87f638 100644 (file)
@@ -93,7 +93,7 @@ FUNCTION: void* glXGetProcAddressARB ( char* procname ) ;
         GLX_RGBA ,
         GLX_DEPTH_SIZE , 16 ,
         0 ,
-    ] int-array{ } make underlying>>
+    ] int-array{ } make
     glXChooseVisual
     [ "Could not get a double-buffered GLX RGBA visual" throw ] unless* ;
 
index 856420af0f701abc67fec6a1f864b80814134aeb..534e47ac3706925c318aa48a52d73b746c879d20 100644 (file)
@@ -50,7 +50,7 @@ SYMBOL: keysym
 : lookup-string ( event xic -- string keysym )
     [
         prepare-lookup
-        swap keybuf get underlying>> buf-size keysym get 0 <int>
+        swap keybuf get buf-size keysym get 0 <int>
         XwcLookupString
         finish-lookup
     ] with-scope ;