Refactor structures more.
This commit is contained in:
@ -17,18 +17,18 @@
|
|||||||
vocabulary structures structures definitions
|
vocabulary structures structures definitions
|
||||||
|
|
||||||
variable last-align
|
variable last-align
|
||||||
: typer ( align sz "name" ) create , ,
|
: typer ( sz "name" ) create dup , 1 max cell min ,
|
||||||
does> dup cell+ @ last-align ! @ ;
|
does> dup cell+ @ last-align ! @ ;
|
||||||
1 1 typer i8
|
1 typer i8
|
||||||
2 2 typer i16
|
2 typer i16
|
||||||
4 4 typer i32
|
4 typer i32
|
||||||
cell 8 typer i64
|
8 typer i64
|
||||||
cell cell typer ptr
|
cell typer ptr
|
||||||
long-size long-size typer long
|
long-size typer long
|
||||||
|
|
||||||
variable last-struct
|
variable last-struct
|
||||||
|
|
||||||
: struct ( "name" ) 1 0 typer latestxt >body last-struct !
|
: struct ( "name" ) 0 typer latestxt >body last-struct !
|
||||||
1 last-align ! ;
|
1 last-align ! ;
|
||||||
: align-by ( a n -- a ) 1- dup >r + r> invert and ;
|
: align-by ( a n -- a ) 1- dup >r + r> invert and ;
|
||||||
: max! ( n a -- ) swap over @ max swap ! ;
|
: max! ( n a -- ) swap over @ max swap ! ;
|
||||||
|
|||||||
Reference in New Issue
Block a user