mirror of
https://github.com/urbit/vere.git
synced 2024-09-11 11:55:31 +03:00
refactor alignment functions
This commit is contained in:
parent
953b21ae82
commit
ba1b0f1e3d
@ -5,7 +5,10 @@
|
||||
cc_library(
|
||||
name = "c3",
|
||||
srcs = glob(
|
||||
["*.h"],
|
||||
[
|
||||
"*.h",
|
||||
"*.c",
|
||||
],
|
||||
exclude = [
|
||||
"c3.h",
|
||||
"*_tests.c",
|
||||
|
5
pkg/c3/defs.c
Normal file
5
pkg/c3/defs.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include "defs.h"
|
||||
|
||||
c3_w c3_align_w(c3_w x, c3_w al, align_dir hilo);
|
||||
c3_d c3_align_d(c3_d x, c3_d al, align_dir hilo);
|
||||
void *c3_align_p(void const * p, size_t al, align_dir hilo);
|
@ -186,10 +186,16 @@
|
||||
# define c3_rename(a, b) ({ \
|
||||
rename(a, b);})
|
||||
|
||||
/* c3_align: hi or lo align x to al
|
||||
/* c3_align(
|
||||
x - the address/quantity to align,
|
||||
al - the alignment,
|
||||
hilo - [C3_ALGHI, C3_ALGLO] high or low align
|
||||
)
|
||||
|
||||
hi or lo align x to al
|
||||
|
||||
unless effective type of x is c3_w or c3_d, assumes x is a pointer.
|
||||
*/
|
||||
*/
|
||||
#define c3_align(x, al, hilo) \
|
||||
_Generic((x), \
|
||||
c3_w : c3_align_w, \
|
||||
|
@ -20,9 +20,6 @@ c3_w u3_Code;
|
||||
//
|
||||
|
||||
void u3a_config_loom(c3_w ver_w);
|
||||
c3_w c3_align_w(c3_w x, c3_w al, align_dir hilo); /* ;;: after rebasing on /vere, these should be declared somewhere else (the align functions) */
|
||||
c3_d c3_align_d(c3_d x, c3_d al, align_dir hilo);
|
||||
void *c3_align_p(void const * p, size_t al, align_dir hilo);
|
||||
void *u3a_into(c3_w x);
|
||||
c3_w u3a_outa(void *p);
|
||||
c3_w u3a_to_off(c3_w som);
|
||||
|
Loading…
Reference in New Issue
Block a user