]> gitweb.factorcode.org Git - factor.git/commitdiff
windows.directx.dinput: pre-construct some intermediate structs to slightly improve...
authorJoe Groff <arcata@gmail.com>
Mon, 3 May 2010 01:14:30 +0000 (18:14 -0700)
committerJoe Groff <arcata@gmail.com>
Mon, 3 May 2010 01:14:30 +0000 (18:14 -0700)
basis/windows/directx/dinput/constants/constants.factor

index 34ab130b59976429d4c76ab5918fa105897b95b5..6a2d9b148d3684242d50b38625e58c0016c5c266 100644 (file)
@@ -48,13 +48,15 @@ M: array array-base-type first ;
 
 : <DIOBJECTDATAFORMAT>-quot ( struct {pguid-var,field,index,dwType-flags,dwFlags} -- quot )
     {
-        [ first dup word? [ '[ _ get ] ] [ drop [ f ] ] if ]
+        [ drop f ]
         [ second rot [ (offsetof) ] [ (sizeof) ] 2bi ]
         [ third * + ]
         [ fourth (flags) ]
         [ 4 swap nth (flag) ]
+        [ first dup word? [ '[ _ get ] ] [ drop [ f ] ] if ]
     } cleave
-    '[ @ _ _ _ DIOBJECTDATAFORMAT <struct-boa> ] ;
+    [ DIOBJECTDATAFORMAT <struct-boa> ] dip
+    '[ _ clone @ >>pguid ] ;
 
 :: make-DIOBJECTDATAFORMAT-array-quot ( struct array -- quot )
     array length '[ _ malloc-DIOBJECTDATAFORMAT-array ]