Various structure related cleanups.
This commit is contained in:
@ -31,8 +31,9 @@ variable last-struct
|
||||
: struct ( "name" ) 1 0 typer latestxt >body last-struct !
|
||||
1 last-align ! ;
|
||||
: align-by ( a n -- a ) 1- dup >r + r> invert and ;
|
||||
: max! ( n a -- ) swap over @ max swap ! ;
|
||||
: struct-align ( n -- )
|
||||
dup last-struct @ cell+ @ max last-struct @ cell+ !
|
||||
dup last-struct @ cell+ max!
|
||||
last-struct @ @ swap align-by last-struct @ ! ;
|
||||
: field ( n "name" )
|
||||
last-align @ struct-align
|
||||
|
||||
@ -55,9 +55,9 @@ z" XFillRectangle" 7 xlib XFillRectangle ( a n n n n n n -- void )
|
||||
|
||||
32 cells constant xevent-size
|
||||
|
||||
: win ( n "name" ) long ;
|
||||
: time ( n "name" ) long ;
|
||||
: bool ( n "name" ) i32 ;
|
||||
: win long ;
|
||||
: time long ;
|
||||
: bool i32 ;
|
||||
|
||||
vocabulary xany also xany definitions
|
||||
struct XAnyEvent
|
||||
|
||||
@ -134,7 +134,7 @@ struct PAINTSTRUCT
|
||||
RECT field ->rcPaint
|
||||
i32 field ->fRestore
|
||||
i32 field ->fIncUpdate
|
||||
32 field ->rgbReserved ( 32 bytes )
|
||||
32 i8 * field ->rgbReserved
|
||||
|
||||
z" FillRect" 3 User32 FillRect
|
||||
z" PostQuitMessage" 1 User32 PostQuitMessage
|
||||
|
||||
Reference in New Issue
Block a user