- add some ATTRIBUTE_UNUSED.

- use shorter boilerplate while at it.
This commit is contained in:
Bernhard Reutner-Fischer 2006-01-30 17:17:14 +00:00
parent 0e8727d93b
commit 20f4000086
13 changed files with 31 additions and 146 deletions

View File

@ -13,20 +13,7 @@
* files as well as stdin/stdout, and to generally behave itself wrt * files as well as stdin/stdout, and to generally behave itself wrt
* command line handling. * command line handling.
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*
*/ */
/* These defines are very important for BusyBox. Without these, /* These defines are very important for BusyBox. Without these,
@ -322,7 +309,7 @@ static void put_short(ush w)
/* ======================================================================== /* ========================================================================
* Signal and error handler. * Signal and error handler.
*/ */
static void abort_gzip(int ignored) static void abort_gzip(int ATTRIBUTE_UNUSED ignored)
{ {
exit(ERROR); exit(ERROR);
} }

View File

@ -4,19 +4,7 @@
* *
* Copyright (C) 2001,2002 by Laurence Anderson * Copyright (C) 2001,2002 by Laurence Anderson
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*/ */
#include <stdio.h> #include <stdio.h>
@ -336,7 +324,7 @@ void fileaction_setowngrp(char *filename, int fileref)
chown (filename, uid, gid); chown (filename, uid, gid);
} }
void fileaction_list(char *filename, int fileref) void fileaction_list(char *filename, int ATTRIBUTE_UNUSED fileref)
{ {
printf("%s\n", filename); printf("%s\n", filename);
} }

View File

@ -7,20 +7,7 @@
* Reworked by (C) 2002 Vladimir Oleynik <dzo@simtreas.ru> * Reworked by (C) 2002 Vladimir Oleynik <dzo@simtreas.ru>
* to correctly parse '-rwxgoa' * to correctly parse '-rwxgoa'
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*
*/ */
/* BB_AUDIT SUSv3 compliant */ /* BB_AUDIT SUSv3 compliant */
@ -44,7 +31,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
return (FALSE); return (FALSE);
} }
int chmod_main(int argc, char **argv) int chmod_main(int ATTRIBUTE_UNUSED argc, char **argv)
{ {
int retval = EXIT_SUCCESS; int retval = EXIT_SUCCESS;
int recursiveFlag = FALSE; int recursiveFlag = FALSE;

View File

@ -22,7 +22,8 @@ static gid_t gid = -1;
static int (*chown_func)(const char *, uid_t, gid_t) = chown; 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, if (!chown_func(fileName,
(uid == -1) ? statbuf->st_uid : uid, (uid == -1) ? statbuf->st_uid : uid,

View File

@ -4,20 +4,7 @@
* *
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*
*/ */
/* BB_AUDIT SUSv3 compliant */ /* BB_AUDIT SUSv3 compliant */
@ -26,7 +13,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "busybox.h" #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; return EXIT_FAILURE;
} }

View File

@ -4,20 +4,7 @@
* *
* Copyright (C) 2000 Edward Betts <edward@debian.org>. * Copyright (C) 2000 Edward Betts <edward@debian.org>.
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*
*/ */
/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
@ -26,7 +13,7 @@
#include <unistd.h> #include <unistd.h>
#include "busybox.h" #include "busybox.h"
extern int hostid_main(int argc, char **argv) extern int hostid_main(int argc, char ATTRIBUTE_UNUSED **argv)
{ {
if (argc > 1) { if (argc > 1) {
bb_show_usage(); bb_show_usage();

View File

@ -4,20 +4,7 @@
* *
* Copyright (C) 2000 Edward Betts <edward@debian.org>. * Copyright (C) 2000 Edward Betts <edward@debian.org>.
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*
*/ */
/* BB_AUDIT SUSv3 compliant */ /* BB_AUDIT SUSv3 compliant */
@ -38,7 +25,7 @@
#include <unistd.h> #include <unistd.h>
#include "busybox.h" #include "busybox.h"
extern int logname_main(int argc, char **argv) extern int logname_main(int argc, char ATTRIBUTE_UNUSED **argv)
{ {
const char *p; const char *p;

View File

@ -5,19 +5,7 @@
* *
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*/ */
#include <stdio.h> #include <stdio.h>
@ -27,11 +15,13 @@
#include <signal.h> #include <signal.h>
#include <termios.h> #include <termios.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "libbb.h"
#define PWD_BUFFER_SIZE 256 #define PWD_BUFFER_SIZE 256
/* do nothing signal handler */ /* do nothing signal handler */
static void askpass_timeout(int ignore) static void askpass_timeout(int ATTRIBUTE_UNUSED ignore)
{ {
} }

View File

@ -5,19 +5,7 @@
* Copyright (c) 1991, 1993 * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
* *
* Original copyright notice is retained at the end of this file. * Original copyright notice is retained at the end of this file.
*/ */
@ -40,7 +28,7 @@
#include <string.h> #include <string.h>
#include "busybox.h" #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 #ifndef CONFIG_FEATURE_FANCY_ECHO
#define eflag '\\' #define eflag '\\'

View File

@ -13,20 +13,7 @@
* *
* Copyright (C) 2001 Hewlett-Packard Laboratories * Copyright (C) 2001 Hewlett-Packard Laboratories
* *
* This program is free software; you can redistribute it and/or modify * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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
*
* *
* This was originally written for blob and then adapted for busybox. * 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 #undef note_error
} }
static void sigalrm_handler(int signum) static void sigalrm_handler(int ATTRIBUTE_UNUSED signum)
{ {
} }

View File

@ -20,7 +20,7 @@ static unsigned int timer_duration = 30;
/* Watchdog file descriptor */ /* Watchdog file descriptor */
static int fd; static int fd;
static void watchdog_shutdown(int unused) static void watchdog_shutdown(int ATTRIBUTE_UNUSED unused)
{ {
write(fd, "V", 1); /* Magic */ write(fd, "V", 1); /* Magic */
close(fd); close(fd);

View File

@ -1,10 +1,7 @@
/* /*
* ipaddress.c "ip address". * ipaddress.c "ip address".
* *
* This program is free software; you can redistribute it and/or * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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.
* *
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
* *
@ -103,7 +100,8 @@ static void print_queuelen(char *name)
printf("qlen %d", ifr.ifr_qlen); 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; FILE *fp = (FILE*)arg;
struct ifinfomsg *ifi = NLMSG_DATA(n); struct ifinfomsg *ifi = NLMSG_DATA(n);
@ -205,7 +203,8 @@ static int flush_update(void)
return 0; 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; FILE *fp = (FILE*)arg;
struct ifaddrmsg *ifa = NLMSG_DATA(n); struct ifaddrmsg *ifa = NLMSG_DATA(n);

View File

@ -1,14 +1,10 @@
/* /*
* utils.c * utils.c
* *
* This program is free software; you can redistribute it and/or * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
* 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.
* *
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
* *
*
* Changes: * Changes:
* *
* Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
@ -321,7 +317,8 @@ int __get_hz(void)
return sysconf(_SC_CLK_TCK); 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) { switch (af) {
case AF_INET: case AF_INET: