]> Savannah Git Hosting - gnulib.git/commitdiff
uninorm/decompose-internal: Avoid "no previous prototype" warning.
authorBruno Haible <bruno@clisp.org>
Wed, 19 Feb 2020 19:28:15 +0000 (20:28 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 19 Feb 2020 19:28:15 +0000 (20:28 +0100)
Reported by Tim Rühsen <tim.ruehsen@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00105.html>.

* lib/array-mergesort.h: Accept an optional macro definition
STATIC_FROMTO.
* lib/uninorm/decompose-internal.c (STATIC_FROMTO): New macro.

ChangeLog
lib/array-mergesort.h
lib/uninorm/decompose-internal.c

index 8215147eee5a974fa5f9c5a1fadb44ed32790230..8649b911083a0361c2980ce88d641cdb29293bb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-02-19  Bruno Haible  <bruno@clisp.org>
+
+       uninorm/decompose-internal: Avoid "no previous prototype" warning.
+       Reported by Tim Rühsen <tim.ruehsen@gmx.de> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00105.html>.
+       * 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  <bruno@clisp.org>
 
        fchmodat: Make more future-proof.
index 3d363bb4e3a2a6084980f313ae0201c78233c57d..bf86d644caa4512fea83d95f4db3d2640aca6ad9 100644 (file)
@@ -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 <stddef.h>
  */
@@ -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)
index 62a7046a8de794194fa1990b558c7442084b8879..e2c20e915b276ce2c0da11e41f1bc32742239ecf 100644 (file)
@@ -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"