]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/com/wrapper/wrapper.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / windows / com / wrapper / wrapper.factor
index 813d8315ac07f0a893c220e66e5e75fb49f37e6c..beac4b6c27397c5a13b13c634946dd8a0a57f839 100755 (executable)
@@ -28,7 +28,7 @@ unless
 "windows.com.wrapper.callbacks" create-vocab drop
 
 : (next-vtbl-counter) ( -- n )
-    +vtbl-counter+ [ 1+ dup ] change ;
+    +vtbl-counter+ [ 1 + dup ] change ;
 
 : com-unwrap ( wrapped -- object )
     +wrapped-objects+ get-global at*
@@ -59,7 +59,7 @@ unless
 : (make-add-ref) ( interfaces -- quot )
     length "void*" heap-size * '[
         _
-        [ alien-unsigned-4 1+ dup ]
+        [ alien-unsigned-4 1 + dup ]
         [ set-alien-unsigned-4 ]
         2bi
     ] ;
@@ -68,7 +68,7 @@ unless
     length "void*" heap-size * '[
         _
         [ drop ]
-        [ alien-unsigned-4 1- dup ]
+        [ alien-unsigned-4 1 - dup ]
         [ set-alien-unsigned-4 ]
         2tri
         dup 0 = [ swap (free-wrapped-object) ] [ nip ] if
@@ -87,13 +87,13 @@ unless
     if ;
 
 : (thunked-quots) ( quots iunknown-methods thunk -- {thunk,quot}s )
-    [ '[ _ '[ @ com-unwrap ] [ swap 2array ] curry map ] ]
-    [ '[ _                   [ swap 2array ] curry map ] ] bi bi*
-    swap append ;
+    [ '[ @ com-unwrap ] [ swap 2array ] curry map ]
+    [                   [ swap 2array ] curry map ] bi-curry bi*
+    prepend ;
 
 : compile-alien-callback ( word return parameters abi quot -- word )
     '[ _ _ _ _ alien-callback ]
-    [ [ (( -- alien )) define-declared ] pick slip ]
+    [ [ (( -- alien )) define-declared ] pick [ call ] dip ]
     with-compilation-unit ;
 
 : (callback-word) ( function-name interface-name counter -- word )
@@ -101,7 +101,7 @@ unless
     "windows.com.wrapper.callbacks" create ;
 
 : (finish-thunk) ( param-count thunk quot -- thunked-quot )
-    [ [ drop [ ] ] [ swap 1- '[ _ _ ndip ] ] if-empty ]
+    [ [ drop [ ] ] [ swap 1 - '[ _ _ ndip ] ] if-empty ]
     dip compose ;
 
 : (make-interface-callbacks) ( interface-name quots iunknown-methods n -- words )
@@ -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( -- callback ) ] void*-array{ } map-as malloc-byte-array ;
 : (callbacks>vtbls) ( callbacks -- vtbls )
     [ (callbacks>vtbl) ] map ;