Mercurial > ~dholland > hg > ag > index.cgi
comparison help2html/uintarray.h @ 9:60b08b68c750
Switch to static inline as an expedient build fix.
Should probably set this up with working C99 inline but for the moment
I don't have the energy.
author | David A. Holland |
---|---|
date | Mon, 30 May 2022 23:56:45 -0400 |
parents | 13d2b8934445 |
children |
comparison
equal
deleted
inserted
replaced
8:ec2b657edf13 | 9:60b08b68c750 |
---|---|
9 struct uintarray *uintarray_create(void); | 9 struct uintarray *uintarray_create(void); |
10 void uintarray_init(struct uintarray *a); | 10 void uintarray_init(struct uintarray *a); |
11 void uintarray_cleanup(struct uintarray *a); | 11 void uintarray_cleanup(struct uintarray *a); |
12 void uintarray_destroy(struct uintarray *a); | 12 void uintarray_destroy(struct uintarray *a); |
13 | 13 |
14 unsigned uintarray_num(const struct uintarray *a); | 14 static inline unsigned uintarray_num(const struct uintarray *a); |
15 unsigned uintarray_get(const struct uintarray *a, unsigned ix); | 15 static inline unsigned uintarray_get(const struct uintarray *a, unsigned ix); |
16 void uintarray_set(struct uintarray *a, unsigned ix, unsigned val); | 16 static inline void uintarray_set(struct uintarray *a, unsigned ix, unsigned val); |
17 void uintarray_add(struct uintarray *a, unsigned val); | 17 void uintarray_add(struct uintarray *a, unsigned val); |
18 void uintarray_setsize(struct uintarray *a, unsigned newsize); | 18 void uintarray_setsize(struct uintarray *a, unsigned newsize); |
19 | 19 |
20 /* x and y are pointers that were placed in the uintarray */ | 20 /* x and y are pointers that were placed in the uintarray */ |
21 void uintarray_sort(struct uintarray *a, int (*f)(unsigned x, unsigned y)); | 21 void uintarray_sort(struct uintarray *a, int (*f)(unsigned x, unsigned y)); |
22 | 22 |
23 extern inline unsigned uintarray_num(const struct uintarray *a) { | 23 static inline unsigned uintarray_num(const struct uintarray *a) { |
24 return a->num; | 24 return a->num; |
25 } | 25 } |
26 | 26 |
27 extern inline unsigned uintarray_get(const struct uintarray *a, unsigned ix) { | 27 static inline unsigned uintarray_get(const struct uintarray *a, unsigned ix) { |
28 assert(ix < a->num); | 28 assert(ix < a->num); |
29 return a->v[ix]; | 29 return a->v[ix]; |
30 } | 30 } |
31 | 31 |
32 extern inline void uintarray_set(struct uintarray *a, unsigned ix, | 32 static inline void uintarray_set(struct uintarray *a, unsigned ix, |
33 unsigned val) { | 33 unsigned val) { |
34 assert(ix < a->num); | 34 assert(ix < a->num); |
35 a->v[ix] = val; | 35 a->v[ix] = val; |
36 } | 36 } |