summaryrefslogtreecommitdiff
path: root/src/grail-bits.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/grail-bits.c')
-rw-r--r--src/grail-bits.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/grail-bits.c b/src/grail-bits.c
index 4c8b941..8ebfb18 100644
--- a/src/grail-bits.c
+++ b/src/grail-bits.c
@@ -46,19 +46,21 @@ static const int grail_first_set_bit[256] =
46 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0, 46 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
47}; 47};
48 48
49void grail_mask_set_mask(grail_mask_t *a, const grail_mask_t *b, int bytes) 49void GRAIL_PUBLIC grail_mask_set_mask(grail_mask_t *a, const grail_mask_t *b,
50 int bytes)
50{ 51{
51 while (bytes--) 52 while (bytes--)
52 *a++ |= *b++; 53 *a++ |= *b++;
53} 54}
54 55
55void grail_mask_clear_mask(grail_mask_t *a, const grail_mask_t *b, int bytes) 56void GRAIL_PUBLIC grail_mask_clear_mask(grail_mask_t *a, const grail_mask_t *b,
57 int bytes)
56{ 58{
57 while (bytes--) 59 while (bytes--)
58 *a++ &= ~*b++; 60 *a++ &= ~*b++;
59} 61}
60 62
61int grail_mask_count(const grail_mask_t *mask, int bytes) 63int GRAIL_PUBLIC grail_mask_count(const grail_mask_t *mask, int bytes)
62{ 64{
63 int count = 0; 65 int count = 0;
64 while (bytes--) 66 while (bytes--)
@@ -66,7 +68,7 @@ int grail_mask_count(const grail_mask_t *mask, int bytes)
66 return count; 68 return count;
67} 69}
68 70
69int grail_mask_get_first(const grail_mask_t *mask, int bytes) 71int GRAIL_PUBLIC grail_mask_get_first(const grail_mask_t *mask, int bytes)
70{ 72{
71 int k; 73 int k;
72 for (k = 0; k < bytes; k++) 74 for (k = 0; k < bytes; k++)
@@ -75,7 +77,7 @@ int grail_mask_get_first(const grail_mask_t *mask, int bytes)
75 return -1; 77 return -1;
76} 78}
77 79
78int grail_mask_get_next(int i, const grail_mask_t *mask, int bytes) 80int GRAIL_PUBLIC grail_mask_get_next(int i, const grail_mask_t *mask, int bytes)
79{ 81{
80 int k = ++i >> 3; 82 int k = ++i >> 3;
81 if (k < bytes) { 83 if (k < bytes) {