From 20f40000864609866b51624351581d067b18469c Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 30 Jan 2006 17:17:14 +0000 Subject: [PATCH] - add some ATTRIBUTE_UNUSED. - use shorter boilerplate while at it. --- archival/gzip.c | 17 ++--------------- archival/rpm.c | 16 ++-------------- coreutils/chmod.c | 17 ++--------------- coreutils/chown.c | 3 ++- coreutils/false.c | 17 ++--------------- coreutils/hostid.c | 17 ++--------------- coreutils/logname.c | 17 ++--------------- libbb/bb_askpass.c | 18 ++++-------------- libbb/bb_echo.c | 16 ++-------------- miscutils/rx.c | 17 ++--------------- miscutils/watchdog.c | 2 +- networking/libiproute/ipaddress.c | 11 +++++------ networking/libiproute/utils.c | 9 +++------ 13 files changed, 31 insertions(+), 146 deletions(-) diff --git a/archival/gzip.c b/archival/gzip.c index 1f268dd26..783a453a7 100644 --- a/archival/gzip.c +++ b/archival/gzip.c @@ -13,20 +13,7 @@ * files as well as stdin/stdout, and to generally behave itself wrt * command line handling. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ /* These defines are very important for BusyBox. Without these, @@ -322,7 +309,7 @@ static void put_short(ush w) /* ======================================================================== * Signal and error handler. */ -static void abort_gzip(int ignored) +static void abort_gzip(int ATTRIBUTE_UNUSED ignored) { exit(ERROR); } diff --git a/archival/rpm.c b/archival/rpm.c index a80f799a6..88e748550 100644 --- a/archival/rpm.c +++ b/archival/rpm.c @@ -4,19 +4,7 @@ * * Copyright (C) 2001,2002 by Laurence Anderson * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include @@ -336,7 +324,7 @@ void fileaction_setowngrp(char *filename, int fileref) chown (filename, uid, gid); } -void fileaction_list(char *filename, int fileref) +void fileaction_list(char *filename, int ATTRIBUTE_UNUSED fileref) { printf("%s\n", filename); } diff --git a/coreutils/chmod.c b/coreutils/chmod.c index 3014d374a..b69cccdf1 100644 --- a/coreutils/chmod.c +++ b/coreutils/chmod.c @@ -7,20 +7,7 @@ * Reworked by (C) 2002 Vladimir Oleynik * to correctly parse '-rwxgoa' * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ /* BB_AUDIT SUSv3 compliant */ @@ -44,7 +31,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk) return (FALSE); } -int chmod_main(int argc, char **argv) +int chmod_main(int ATTRIBUTE_UNUSED argc, char **argv) { int retval = EXIT_SUCCESS; int recursiveFlag = FALSE; diff --git a/coreutils/chown.c b/coreutils/chown.c index 888c3fc89..660d08947 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c @@ -22,7 +22,8 @@ static gid_t gid = -1; static int (*chown_func)(const char *, uid_t, gid_t) = chown; -static int fileAction(const char *fileName, struct stat *statbuf, void* junk) +static int fileAction(const char *fileName, struct stat *statbuf, + void ATTRIBUTE_UNUSED *junk) { if (!chown_func(fileName, (uid == -1) ? statbuf->st_uid : uid, diff --git a/coreutils/false.c b/coreutils/false.c index 5cf238409..b06ef8b62 100644 --- a/coreutils/false.c +++ b/coreutils/false.c @@ -4,20 +4,7 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ /* BB_AUDIT SUSv3 compliant */ @@ -26,7 +13,7 @@ #include #include "busybox.h" -extern int false_main(int argc, char **argv) +extern int false_main(int ATTRIBUTE_UNUSED argc, char ATTRIBUTE_UNUSED **argv) { return EXIT_FAILURE; } diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 917dc223e..0c11ca385 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c @@ -4,20 +4,7 @@ * * Copyright (C) 2000 Edward Betts . * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ @@ -26,7 +13,7 @@ #include #include "busybox.h" -extern int hostid_main(int argc, char **argv) +extern int hostid_main(int argc, char ATTRIBUTE_UNUSED **argv) { if (argc > 1) { bb_show_usage(); diff --git a/coreutils/logname.c b/coreutils/logname.c index ca5eb41cf..e2a74f932 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c @@ -4,20 +4,7 @@ * * Copyright (C) 2000 Edward Betts . * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ /* BB_AUDIT SUSv3 compliant */ @@ -38,7 +25,7 @@ #include #include "busybox.h" -extern int logname_main(int argc, char **argv) +extern int logname_main(int argc, char ATTRIBUTE_UNUSED **argv) { const char *p; diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c index 42ccd66d3..65ddd5a24 100644 --- a/libbb/bb_askpass.c +++ b/libbb/bb_askpass.c @@ -5,19 +5,7 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include @@ -27,11 +15,13 @@ #include #include #include + +#include "libbb.h" #define PWD_BUFFER_SIZE 256 /* do nothing signal handler */ -static void askpass_timeout(int ignore) +static void askpass_timeout(int ATTRIBUTE_UNUSED ignore) { } diff --git a/libbb/bb_echo.c b/libbb/bb_echo.c index 387ee9669..41e6e4915 100644 --- a/libbb/bb_echo.c +++ b/libbb/bb_echo.c @@ -5,19 +5,7 @@ * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * * Original copyright notice is retained at the end of this file. */ @@ -40,7 +28,7 @@ #include #include "busybox.h" -extern int bb_echo(int argc, char** argv) +extern int bb_echo(int ATTRIBUTE_UNUSED argc, char **argv) { #ifndef CONFIG_FEATURE_FANCY_ECHO #define eflag '\\' diff --git a/miscutils/rx.c b/miscutils/rx.c index 8edc8877a..c7e82ead5 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -13,20 +13,7 @@ * * Copyright (C) 2001 Hewlett-Packard Laboratories * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * * This was originally written for blob and then adapted for busybox. * @@ -285,7 +272,7 @@ static int receive(char *error_buf, size_t error_buf_size, #undef note_error } -static void sigalrm_handler(int signum) +static void sigalrm_handler(int ATTRIBUTE_UNUSED signum) { } diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 944288d29..55dd69857 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -20,7 +20,7 @@ static unsigned int timer_duration = 30; /* Watchdog file descriptor */ static int fd; -static void watchdog_shutdown(int unused) +static void watchdog_shutdown(int ATTRIBUTE_UNUSED unused) { write(fd, "V", 1); /* Magic */ close(fd); diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index c5e6e4ea5..12b8fc8f8 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c @@ -1,10 +1,7 @@ /* * ipaddress.c "ip address". * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * * Authors: Alexey Kuznetsov, * @@ -103,7 +100,8 @@ static void print_queuelen(char *name) printf("qlen %d", ifr.ifr_qlen); } -static int print_linkinfo(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) +static int print_linkinfo(struct sockaddr_nl ATTRIBUTE_UNUSED *who, + struct nlmsghdr *n, void ATTRIBUTE_UNUSED *arg) { FILE *fp = (FILE*)arg; struct ifinfomsg *ifi = NLMSG_DATA(n); @@ -205,7 +203,8 @@ static int flush_update(void) return 0; } -static int print_addrinfo(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) +static int print_addrinfo(struct sockaddr_nl ATTRIBUTE_UNUSED *who, + struct nlmsghdr *n, void ATTRIBUTE_UNUSED *arg) { FILE *fp = (FILE*)arg; struct ifaddrmsg *ifa = NLMSG_DATA(n); diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c index e6b386c1d..0dd5d9519 100644 --- a/networking/libiproute/utils.c +++ b/networking/libiproute/utils.c @@ -1,14 +1,10 @@ /* * utils.c * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * * Authors: Alexey Kuznetsov, * - * * Changes: * * Rani Assaf 980929: resolve addresses @@ -321,7 +317,8 @@ int __get_hz(void) return sysconf(_SC_CLK_TCK); } -const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen) +const char *rt_addr_n2a(int af, int ATTRIBUTE_UNUSED len, + void *addr, char *buf, int buflen) { switch (af) { case AF_INET: -- 2.25.1