]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid bit rot of unused code.
authorBruno Haible <bruno@clisp.org>
Fri, 21 Mar 2025 22:55:42 +0000 (23:55 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 21 Mar 2025 22:55:42 +0000 (23:55 +0100)
* gettext-tools/src/format-lisp.c: Include attribute.h.
(intersection): Mark with MAYBE_UNUSED instead of '#ifdef unused'.
* gettext-tools/src/format-scheme.c (intersection): Likewise.
* gettext-tools/src/x-csharp.c (phase5_ungetc): Likewise.
* gettext-tools/src/x-php.c (phase3_ungetc): Likewise.

gettext-tools/src/format-lisp.c
gettext-tools/src/format-scheme.c
gettext-tools/src/x-csharp.c
gettext-tools/src/x-php.c

index f0c17888d386f93855a24721cfeb2860a3d2733d..69dd5b329d7ba0cf8aaba7b8cc7ea1b925c7a936 100644 (file)
@@ -1,5 +1,5 @@
 /* Lisp format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009, 2014, 2019, 2023 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 
 #include "format.h"
+#include "attribute.h"
 #include "c-ctype.h"
 #include "gcd.h"
 #include "xalloc.h"
@@ -1344,12 +1345,11 @@ make_intersection_with_empty_list (struct format_arg_list *list)
 }
 
 
-#ifdef unused
 /* Create the intersection of two argument list constraints.  NULL stands
    for an impossible situation, i.e. a contradiction.  */
 /* Memory effects: list1 and list2 are freed if non-NULL.  The result,
    if non-NULL, is freshly allocated.  */
-static struct format_arg_list *
+MAYBE_UNUSED static struct format_arg_list *
 intersection (struct format_arg_list *list1, struct format_arg_list *list2)
 {
   if (list1 != NULL)
@@ -1373,7 +1373,6 @@ intersection (struct format_arg_list *list1, struct format_arg_list *list2)
         return NULL;
     }
 }
-#endif
 
 
 /* ===================== Union of two format_arg_lists ===================== */
index 0841587004134c1b0320aea9ef0f29d7684446ba..8017304ac02f0d3a8bf38254aeb2a3d74cb9259c 100644 (file)
@@ -1,5 +1,5 @@
 /* Scheme format strings.
-   Copyright (C) 2001-2024 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -1357,12 +1357,11 @@ make_intersection_with_empty_list (struct format_arg_list *list)
 }
 
 
-#ifdef unused
 /* Create the intersection of two argument list constraints.  NULL stands
    for an impossible situation, i.e. a contradiction.  */
 /* Memory effects: list1 and list2 are freed if non-NULL.  The result,
    if non-NULL, is freshly allocated.  */
-static struct format_arg_list *
+MAYBE_UNUSED static struct format_arg_list *
 intersection (struct format_arg_list *list1, struct format_arg_list *list2)
 {
   if (list1 != NULL)
@@ -1386,7 +1385,6 @@ intersection (struct format_arg_list *list1, struct format_arg_list *list2)
         return NULL;
     }
 }
-#endif
 
 
 /* ===================== Union of two format_arg_lists ===================== */
index 3d43e89bf7413e602617b6f363c3dc7dc3c1a760..0b3af4880d758774570bbaacacda1eb5862d6cee 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext C# backend.
-   Copyright (C) 2003-2024 Free Software Foundation, Inc.
+   Copyright (C) 2003-2025 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -1229,8 +1229,7 @@ phase5_getc ()
     }
 }
 
-#ifdef unused
-static void
+MAYBE_UNUSED static void
 phase5_ungetc (int c)
 {
   if (c != UEOF)
@@ -1240,7 +1239,6 @@ phase5_ungetc (int c)
       phase5_pushback[phase5_pushback_length++] = c;
     }
 }
-#endif
 
 
 /* ========================== Reading of tokens.  ========================== */
index 29fcc9f452768391018487b02195c08dd3b9b690..762993a6c6637267e45083093b71bb36702f0dcb 100644 (file)
@@ -791,8 +791,7 @@ phase3_getc (struct php_extractor *xp)
     return c;
 }
 
-#ifdef unused
-static void
+MAYBE_UNUSED static void
 phase3_ungetc (struct php_extractor *xp, int c)
 {
   if (c != EOF)
@@ -802,7 +801,6 @@ phase3_ungetc (struct php_extractor *xp, int c)
       xp->phase3_pushback[xp->phase3_pushback_length++] = c;
     }
 }
-#endif
 
 
 /* ========================== Reading of tokens.  ========================== */