comparison help2html/array.c @ 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
31 31
32 /* 32 /*
33 * I wish there were a way to check that these were the same as the 33 * I wish there were a way to check that these were the same as the
34 * inline versions, but apparently allowing such things to diverge is 34 * inline versions, but apparently allowing such things to diverge is
35 * a feature of C99. Bleh. 35 * a feature of C99. Bleh.
36 *
37 * Update: it all broke anyway, so I've switched to static inline as
38 * an expedient. Thus, at least for the time being, we don't need the
39 * extra copies.
36 */ 40 */
37 41
42 #if 0
38 unsigned array_num(const struct array *a) { 43 unsigned array_num(const struct array *a) {
39 return a->num; 44 return a->num;
40 } 45 }
41 46
42 void *array_get(const struct array *a, unsigned ix) { 47 void *array_get(const struct array *a, unsigned ix) {
46 51
47 void array_set(struct array *a, unsigned ix, void *ptr) { 52 void array_set(struct array *a, unsigned ix, void *ptr) {
48 assert(ix < a->num); 53 assert(ix < a->num);
49 a->v[ix] = ptr; 54 a->v[ix] = ptr;
50 } 55 }
56 #endif
51 57
52 //////////////////////////////////////////////////////////// 58 ////////////////////////////////////////////////////////////
53 59
54 unsigned array_add(struct array *a, void *ptr) { 60 unsigned array_add(struct array *a, void *ptr) {
55 unsigned ix; 61 unsigned ix;