# HG changeset patch # User David A. Holland # Date 1653969405 14400 # Node ID 60b08b68c75082867936238e101db3381693298f # Parent ec2b657edf1316a7bf975f8566d7940f37d50228 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. diff -r ec2b657edf13 -r 60b08b68c750 help2html/array.c --- a/help2html/array.c Mon May 30 23:51:43 2022 -0400 +++ b/help2html/array.c Mon May 30 23:56:45 2022 -0400 @@ -33,8 +33,13 @@ * I wish there were a way to check that these were the same as the * inline versions, but apparently allowing such things to diverge is * a feature of C99. Bleh. + * + * Update: it all broke anyway, so I've switched to static inline as + * an expedient. Thus, at least for the time being, we don't need the + * extra copies. */ +#if 0 unsigned array_num(const struct array *a) { return a->num; } @@ -48,6 +53,7 @@ assert(ix < a->num); a->v[ix] = ptr; } +#endif //////////////////////////////////////////////////////////// diff -r ec2b657edf13 -r 60b08b68c750 help2html/array.h --- a/help2html/array.h Mon May 30 23:51:43 2022 -0400 +++ b/help2html/array.h Mon May 30 23:56:45 2022 -0400 @@ -11,9 +11,9 @@ void array_cleanup(struct array *a); void array_destroy(struct array *a); -unsigned array_num(const struct array *a); -void *array_get(const struct array *a, unsigned ix); -void array_set(struct array *a, unsigned ix, void *ptr); +static inline unsigned array_num(const struct array *a); +static inline void *array_get(const struct array *a, unsigned ix); +static inline void array_set(struct array *a, unsigned ix, void *ptr); unsigned array_add(struct array *a, void *ptr); void array_setsize(struct array *a, unsigned newsize); @@ -23,16 +23,16 @@ /* x and y are pointers that were placed in the array */ void array_sort(struct array *a, int (*f)(void *x, void *y)); -extern inline unsigned array_num(const struct array *a) { +static inline unsigned array_num(const struct array *a) { return a->num; } -extern inline void *array_get(const struct array *a, unsigned ix) { +static inline void *array_get(const struct array *a, unsigned ix) { assert(ix < a->num); return a->v[ix]; } -extern inline void array_set(struct array *a, unsigned ix, void *ptr) { +static inline void array_set(struct array *a, unsigned ix, void *ptr) { assert(ix < a->num); a->v[ix] = ptr; } diff -r ec2b657edf13 -r 60b08b68c750 help2html/uintarray.c --- a/help2html/uintarray.c Mon May 30 23:51:43 2022 -0400 +++ b/help2html/uintarray.c Mon May 30 23:56:45 2022 -0400 @@ -33,8 +33,13 @@ * I wish there were a way to check that these were the same as the * inline versions, but apparently allowing such things to diverge is * a feature of C99. Bleh. + * + * Update: it all broke anyway, so I've switched to static inline as + * an expedient. Thus, at least for the time being, we don't need the + * extra copies. */ +#if 0 unsigned uintarray_num(const struct uintarray *a) { return a->num; } @@ -48,6 +53,7 @@ assert(ix < a->num); a->v[ix] = val; } +#endif //////////////////////////////////////////////////////////// diff -r ec2b657edf13 -r 60b08b68c750 help2html/uintarray.h --- a/help2html/uintarray.h Mon May 30 23:51:43 2022 -0400 +++ b/help2html/uintarray.h Mon May 30 23:56:45 2022 -0400 @@ -11,25 +11,25 @@ void uintarray_cleanup(struct uintarray *a); void uintarray_destroy(struct uintarray *a); -unsigned uintarray_num(const struct uintarray *a); -unsigned uintarray_get(const struct uintarray *a, unsigned ix); -void uintarray_set(struct uintarray *a, unsigned ix, unsigned val); +static inline unsigned uintarray_num(const struct uintarray *a); +static inline unsigned uintarray_get(const struct uintarray *a, unsigned ix); +static inline void uintarray_set(struct uintarray *a, unsigned ix, unsigned val); void uintarray_add(struct uintarray *a, unsigned val); void uintarray_setsize(struct uintarray *a, unsigned newsize); /* x and y are pointers that were placed in the uintarray */ void uintarray_sort(struct uintarray *a, int (*f)(unsigned x, unsigned y)); -extern inline unsigned uintarray_num(const struct uintarray *a) { +static inline unsigned uintarray_num(const struct uintarray *a) { return a->num; } -extern inline unsigned uintarray_get(const struct uintarray *a, unsigned ix) { +static inline unsigned uintarray_get(const struct uintarray *a, unsigned ix) { assert(ix < a->num); return a->v[ix]; } -extern inline void uintarray_set(struct uintarray *a, unsigned ix, +static inline void uintarray_set(struct uintarray *a, unsigned ix, unsigned val) { assert(ix < a->num); a->v[ix] = val;