diff options
author | Colin Watson <cjwatson@debian.org> | 2022-01-09 00:32:11 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-01-09 00:32:11 +0000 |
commit | b1974937b100fe46027cd7b3f9ebc9fed479ed9d (patch) | |
tree | cdca8acc6f71247f87ce654809318abcdc605126 /src | |
parent | 84b6689805b971b1a229f060a92658571c1daa07 (diff) |
Use MAYBE_UNUSED rather than _GL_UNUSED
We should be using the public name from Gnulib's `attribute.h`.
* lib/orderfiles.c (order_files) [!HAVE_LINUX_FIEMAP_H &&
!HAVE_POSIX_FADVISE]: Use MAYBE_UNUSED rather than _GL_UNUSED.
* lib/sandbox.c (_sandbox_load) [!HAVE_LIBSECCOMP]: Likewise.
* lib/security.c (drop_privs): Likewise.
* libdb/db_ndbm.c (unsorted_nextkey): Likewise.
* src/accessdb.c (help_filter): Likewise.
* src/check_mandirs.c (chown_if_possible) [!MAN_OWNER]: Likewise.
* src/convert.c (close_conv_to_locale): Likewise.
* src/decompress.c (decompress_zlib): Likewise.
* src/lexgrog_test.c (help_filter): Likewise.
* src/man.c (help_filter, squeeze_blank_lines, disable_hyphenation,
disable_justification): Likewise.
* src/manconv.c (manconv): Likewise.
* src/manp.c (free_config_file): Likewise.
* src/tests/fspause.c (main): Likewise.
* src/whatis.c (help_filter): Likewise.
* src/zsoelim_main.c (parse_opt): Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/accessdb.c | 3 | ||||
-rw-r--r-- | src/check_mandirs.c | 3 | ||||
-rw-r--r-- | src/convert.c | 4 | ||||
-rw-r--r-- | src/decompress.c | 3 | ||||
-rw-r--r-- | src/lexgrog_test.c | 3 | ||||
-rw-r--r-- | src/man.c | 9 | ||||
-rw-r--r-- | src/manconv.c | 5 | ||||
-rw-r--r-- | src/manp.c | 2 | ||||
-rw-r--r-- | src/tests/fspause.c | 3 | ||||
-rw-r--r-- | src/whatis.c | 2 | ||||
-rw-r--r-- | src/zsoelim_main.c | 3 |
11 files changed, 25 insertions, 15 deletions
diff --git a/src/accessdb.c b/src/accessdb.c index c0910196..dec144bd 100644 --- a/src/accessdb.c +++ b/src/accessdb.c @@ -35,6 +35,7 @@ #include <assert.h> #include "argp.h" +#include "attribute.h" #include "progname.h" #include "xvasprintf.h" @@ -90,7 +91,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" -static char *help_filter (int key, const char *text, void *input _GL_UNUSED) +static char *help_filter (int key, const char *text, void *input MAYBE_UNUSED) { switch (key) { case ARGP_KEY_HELP_PRE_DOC: diff --git a/src/check_mandirs.c b/src/check_mandirs.c index 77aa9694..6076f911 100644 --- a/src/check_mandirs.c +++ b/src/check_mandirs.c @@ -44,6 +44,7 @@ #include <dirent.h> #include <unistd.h> +#include "attribute.h" #include "dirname.h" #include "gl_array_list.h" #include "gl_hash_map.h" @@ -393,7 +394,7 @@ void chown_if_possible (const char *path) } } #else /* !MAN_OWNER */ -void chown_if_possible (const char *path _GL_UNUSED) +void chown_if_possible (const char *path MAYBE_UNUSED) { } #endif /* MAN_OWNER */ diff --git a/src/convert.c b/src/convert.c index 2649e9eb..b21209fe 100644 --- a/src/convert.c +++ b/src/convert.c @@ -32,6 +32,8 @@ # include <iconv.h> #endif /* HAVE_ICONV */ +#include "attribute.h" + #include "manconfig.h" #include "cleanup.h" @@ -43,7 +45,7 @@ static bool conv_to_locale_initialized = false; static iconv_t conv_to_locale = (iconv_t) -1; -static void close_conv_to_locale (void *ignored _GL_UNUSED) +static void close_conv_to_locale (void *ignored MAYBE_UNUSED) { iconv_close (conv_to_locale); } diff --git a/src/decompress.c b/src/decompress.c index 5cee5ff7..df2914c0 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -36,6 +36,7 @@ # include "zlib.h" #endif /* HAVE_LIBZ */ +#include "attribute.h" #include "xvasprintf.h" #include "manconfig.h" @@ -46,7 +47,7 @@ #ifdef HAVE_LIBZ -static void decompress_zlib (void *data _GL_UNUSED) +static void decompress_zlib (void *data MAYBE_UNUSED) { gzFile zlibfile; int fd; diff --git a/src/lexgrog_test.c b/src/lexgrog_test.c index 77c9a134..fec69ec3 100644 --- a/src/lexgrog_test.c +++ b/src/lexgrog_test.c @@ -34,6 +34,7 @@ #include <sys/stat.h> #include "argp.h" +#include "attribute.h" #include "error.h" #include "gl_list.h" #include "progname.h" @@ -132,7 +133,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) return ARGP_ERR_UNKNOWN; } -static char *help_filter (int key, const char *text, void *input _GL_UNUSED) +static char *help_filter (int key, const char *text, void *input MAYBE_UNUSED) { switch (key) { case ARGP_KEY_HELP_PRE_DOC: @@ -58,6 +58,7 @@ #include <sys/stat.h> #include "argp.h" +#include "attribute.h" #include "dirname.h" #include "gl_array_list.h" #include "gl_hash_map.h" @@ -553,7 +554,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" -static char *help_filter (int key, const char *text, void *input _GL_UNUSED) +static char *help_filter (int key, const char *text, void *input MAYBE_UNUSED) { #ifdef HAS_TROFF # ifdef TROFF_IS_GROFF @@ -1542,7 +1543,7 @@ static void add_output_iconv (pipeline *p, /* Pipeline command to squeeze multiple blank lines into one. * */ -static void squeeze_blank_lines (void *data _GL_UNUSED) +static void squeeze_blank_lines (void *data MAYBE_UNUSED) { char *line = NULL; size_t len = 0; @@ -2065,7 +2066,7 @@ static void display_catman (const char *cat_file, pipeline *decomp, free (tmpcat); } -static void disable_hyphenation (void *data _GL_UNUSED) +static void disable_hyphenation (void *data MAYBE_UNUSED) { fputs (".nh\n" ".de hy\n" @@ -2073,7 +2074,7 @@ static void disable_hyphenation (void *data _GL_UNUSED) ".lf 1\n", stdout); } -static void disable_justification (void *data _GL_UNUSED) +static void disable_justification (void *data MAYBE_UNUSED) { fputs (".na\n" ".de ad\n" diff --git a/src/manconv.c b/src/manconv.c index 4b06398f..8ed994d0 100644 --- a/src/manconv.c +++ b/src/manconv.c @@ -46,6 +46,7 @@ #endif /* HAVE_ICONV */ #include "argp.h" +#include "attribute.h" #include "gl_list.h" #include "gettext.h" @@ -354,8 +355,8 @@ void manconv (pipeline *p, gl_list_t from, const char *to) /* If we don't have iconv, there isn't much we can do; just pass everything * through unchanged. */ -void manconv (pipeline *p, gl_list_t from _GL_UNUSED, - const char *to _GL_UNUSED) +void manconv (pipeline *p, gl_list_t from MAYBE_UNUSED, + const char *to MAYBE_UNUSED) { for (;;) { size_t len = 4096; @@ -808,7 +808,7 @@ next: free (buf); } -static void free_config_file (void *unused _GL_UNUSED) +static void free_config_file (void *unused MAYBE_UNUSED) { gl_list_free (config); } diff --git a/src/tests/fspause.c b/src/tests/fspause.c index 092fbb4f..4f573c62 100644 --- a/src/tests/fspause.c +++ b/src/tests/fspause.c @@ -32,6 +32,7 @@ #include <time.h> #include <unistd.h> +#include "attribute.h" #include "progname.h" #include "stat-time.h" #include "timespec.h" @@ -84,7 +85,7 @@ static int try_delay (struct stat *st, int delay_ns) return timespec_cmp (start_ts, end_ts) != 0; } -int main (int argc _GL_UNUSED, char **argv) +int main (int argc MAYBE_UNUSED, char **argv) { struct stat st; int delay_ns; diff --git a/src/whatis.c b/src/whatis.c index 4c153c05..cda72e03 100644 --- a/src/whatis.c +++ b/src/whatis.c @@ -236,7 +236,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) return ARGP_ERR_UNKNOWN; } -static char *help_filter (int key, const char *text, void *input _GL_UNUSED) +static char *help_filter (int key, const char *text, void *input MAYBE_UNUSED) { switch (key) { case ARGP_KEY_HELP_PRE_DOC: diff --git a/src/zsoelim_main.c b/src/zsoelim_main.c index 856997ef..20f02a6a 100644 --- a/src/zsoelim_main.c +++ b/src/zsoelim_main.c @@ -31,6 +31,7 @@ #include <stdlib.h> #include "argp.h" +#include "attribute.h" #include "gl_list.h" #include "progname.h" #include "xvasprintf.h" @@ -71,7 +72,7 @@ static struct argp_option options[] = { { 0 } }; -static error_t parse_opt (int key, char *arg _GL_UNUSED, +static error_t parse_opt (int key, char *arg MAYBE_UNUSED, struct argp_state *state) { switch (key) { |