From 8f2e74a91f2c9118cb86a632a7bef5c7b394d1ab Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 19 Feb 2020 20:28:15 +0100 Subject: [PATCH] uninorm/decompose-internal: Avoid "no previous prototype" warning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Tim Rühsen in . * lib/array-mergesort.h: Accept an optional macro definition STATIC_FROMTO. * lib/uninorm/decompose-internal.c (STATIC_FROMTO): New macro. --- ChangeLog | 9 +++++++++ lib/array-mergesort.h | 9 ++++++++- lib/uninorm/decompose-internal.c | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8215147eee..8649b91108 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2020-02-19 Bruno Haible + + uninorm/decompose-internal: Avoid "no previous prototype" warning. + Reported by Tim Rühsen in + . + * lib/array-mergesort.h: Accept an optional macro definition + STATIC_FROMTO. + * lib/uninorm/decompose-internal.c (STATIC_FROMTO): New macro. + 2020-02-16 Bruno Haible fchmodat: Make more future-proof. diff --git a/lib/array-mergesort.h b/lib/array-mergesort.h index 3d363bb4e3..bf86d644ca 100644 --- a/lib/array-mergesort.h +++ b/lib/array-mergesort.h @@ -29,6 +29,8 @@ respectively, less, equal, or greater than the element pointed to by the second argument. STATIC The storage class of the functions being defined. + STATIC_FROMTO (Optional.) Overrides STATIC for the 'merge_sort_fromto' + function. Before including this file, you also need to include: #include */ @@ -87,7 +89,12 @@ merge (const ELEMENT *src1, size_t n1, /* Sort src[0..n-1] into dst[0..n-1], using tmp[0..n/2-1] as temporary (scratch) storage. The arrays src, dst, tmp must not overlap. */ -STATIC void +#ifdef STATIC_FROMTO +STATIC_FROMTO +#else +STATIC +#endif +void merge_sort_fromto (const ELEMENT *src, ELEMENT *dst, size_t n, ELEMENT *tmp) { switch (n) diff --git a/lib/uninorm/decompose-internal.c b/lib/uninorm/decompose-internal.c index 62a7046a8d..e2c20e915b 100644 --- a/lib/uninorm/decompose-internal.c +++ b/lib/uninorm/decompose-internal.c @@ -23,6 +23,7 @@ #define ELEMENT struct ucs4_with_ccc #define COMPARE(a,b) ((a)->ccc - (b)->ccc) #define STATIC +#define STATIC_FROMTO static #define merge_sort_fromto gl_uninorm_decompose_merge_sort_fromto #define merge_sort_inplace gl_uninorm_decompose_merge_sort_inplace #include "array-mergesort.h" -- 2.39.5