projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove unused variables.
[gnulib.git]
/
lib
/
sig2str.c
diff --git
a/lib/sig2str.c
b/lib/sig2str.c
index
1edc9f1
..
9252b28
100644
(file)
--- a/
lib/sig2str.c
+++ b/
lib/sig2str.c
@@
-1,11
+1,11
@@
/* sig2str.c -- convert between signal names and numbers
/* sig2str.c -- convert between signal names and numbers
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002
, 2004, 2006
Free Software Foundation, Inc.
- This program is free software
;
you can redistribute it and/or modify
+ 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
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2, or (at your option)
- any later version.
+ the Free Software Foundation; either version
3 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
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-13,14
+13,11
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
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. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include <limits.h>
#include <signal.h>
#include <limits.h>
#include <signal.h>
@@
-28,13
+25,6
@@
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-#ifndef WTERMSIG
-# define WTERMSIG(s) ((s) & 0x7F)
-#endif
-
#include "sig2str.h"
#ifndef SIGRTMIN
#include "sig2str.h"
#ifndef SIGRTMIN
@@
-224,7
+214,7
@@
static struct numname { int num; char const name[8]; } numname_table[] =
#endif
/* Older AIX versions. */
#endif
/* Older AIX versions. */
-#ifdef SIGALRM1
+#ifdef SIGALRM1
NUMNAME (ALRM1), /* unknown; taken from Bash 2.05 */
#endif
#ifdef SIGKAP
NUMNAME (ALRM1), /* unknown; taken from Bash 2.05 */
#endif
#ifdef SIGKAP
@@
-254,13
+244,13
@@
static struct numname { int num; char const name[8]; } numname_table[] =
#define NUMNAME_ENTRIES (sizeof numname_table / sizeof numname_table[0])
/* ISDIGIT differs from isdigit, as follows:
#define NUMNAME_ENTRIES (sizeof numname_table / sizeof numname_table[0])
/* ISDIGIT differs from isdigit, as follows:
- - Its arg may be any int or unsigned int; it need not be an unsigned char
.
-
- It's guaranteed to evaluate its argument exactly once
.
+ - Its arg may be any int or unsigned int; it need not be an unsigned char
+
or EOF
.
- It's typically faster.
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
- It's typically faster.
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
-
ISDIGIT_LOCALE
unless it's important to use the locale's definition
+
isdigit
unless it's important to use the locale's definition
of `digit' even when the host does not conform to POSIX. */
of `digit' even when the host does not conform to POSIX. */
-#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
+#define ISDIGIT(c) ((unsigned
int
) (c) - '0' <= 9)
/* Convert the signal name SIGNAME to a signal number. Return the
signal number if successful, -1 otherwise. */
/* Convert the signal name SIGNAME to a signal number. Return the
signal number if successful, -1 otherwise. */
@@
-277,7
+267,7
@@
str2signum (char const *signame)
}
else
{
}
else
{
- int i;
+
unsigned
int i;
for (i = 0; i < NUMNAME_ENTRIES; i++)
if (strcmp (numname_table[i].name, signame) == 0)
return numname_table[i].num;
for (i = 0; i < NUMNAME_ENTRIES; i++)
if (strcmp (numname_table[i].name, signame) == 0)
return numname_table[i].num;
@@
-322,7
+312,7
@@
str2sig (char const *signame, int *signum)
int
sig2str (int signum, char *signame)
{
int
sig2str (int signum, char *signame)
{
- int i;
+
unsigned
int i;
for (i = 0; i < NUMNAME_ENTRIES; i++)
if (numname_table[i].num == signum)
{
for (i = 0; i < NUMNAME_ENTRIES; i++)
if (numname_table[i].num == signum)
{