From: Joe Groff Date: Mon, 3 May 2010 01:14:30 +0000 (-0700) Subject: windows.directx.dinput: pre-construct some intermediate structs to slightly improve... X-Git-Tag: 0.97~4670^2~49 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=c167646e3b0ab705dca8595fbe7400bf4425e236 windows.directx.dinput: pre-construct some intermediate structs to slightly improve horrible compilation time on the gigantic macro expansions --- diff --git a/basis/windows/directx/dinput/constants/constants.factor b/basis/windows/directx/dinput/constants/constants.factor index 34ab130b59..6a2d9b148d 100644 --- a/basis/windows/directx/dinput/constants/constants.factor +++ b/basis/windows/directx/dinput/constants/constants.factor @@ -48,13 +48,15 @@ M: array array-base-type first ; : -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 ] ; + [ DIOBJECTDATAFORMAT ] dip + '[ _ clone @ >>pguid ] ; :: make-DIOBJECTDATAFORMAT-array-quot ( struct array -- quot ) array length '[ _ malloc-DIOBJECTDATAFORMAT-array ]