From 1bd7b85b039747238773c4538bcf0509bf4f4a6e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 4 May 2010 02:31:36 -0500 Subject: [PATCH] windows.directx.dinput.constants: fix breakage if image is saved and restarted --- .../directx/dinput/constants/constants.factor | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) mode change 100644 => 100755 basis/windows/directx/dinput/constants/constants.factor diff --git a/basis/windows/directx/dinput/constants/constants.factor b/basis/windows/directx/dinput/constants/constants.factor old mode 100644 new mode 100755 index 6a2d9b148d..98ea261d38 --- a/basis/windows/directx/dinput/constants/constants.factor +++ b/basis/windows/directx/dinput/constants/constants.factor @@ -1,8 +1,8 @@ -USING: windows.directx.dinput windows.kernel32 windows.ole32 windows.com -windows.com.syntax alien alien.c-types alien.data alien.syntax -kernel system namespaces combinators sequences fry math accessors -macros words quotations libc continuations generalizations -splitting locals assocs init specialized-arrays memoize +USING: windows.directx.dinput windows.kernel32 windows.ole32 +windows.com windows.com.syntax alien alien.c-types alien.data +alien.syntax kernel system namespaces combinators sequences fry +math accessors macros words quotations libc continuations +generalizations splitting locals assocs init specialized-arrays classes.struct strings arrays literals ; SPECIALIZED-ARRAY: DIOBJECTDATAFORMAT IN: windows.directx.dinput.constants @@ -20,21 +20,21 @@ SYMBOLS: > [ name>> = ] with find nip ; + c-type fields>> [ name>> = ] with find nip ; : (offsetof) ( field struct -- offset ) [ (field-spec-of) offset>> ] [ drop 0 ] if* ; : (sizeof) ( field struct -- size ) - [ (field-spec-of) type>> array-base-type heap-size* ] [ drop 1 ] if* ; + [ (field-spec-of) type>> array-base-type heap-size ] [ drop 1 ] if* ; : (flag) ( thing -- integer ) { @@ -832,8 +832,7 @@ MACRO: ( dwFlags dwDataSize struct rgodf-array -- alien ) [ define-constants ] "windows.directx.dinput.constants" add-startup-hook : uninitialize ( variable quot -- ) - [ '[ _ when* f ] change-global ] - [ drop global delete-at ] 2bi ; inline + [ [ get-global ] dip when* ] [ drop global delete-at ] 2bi ; inline : free-dinput-constants ( -- ) { -- 2.34.1