X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsig2str.c;h=cf2819daab7d487490be4f4bfe38deade1e59ba3;hb=b566a1cae5310716bad3151cee69f943915b2d31;hp=4096465dd75d5916ea24458326be2046d75a9ef3;hpb=a7ae35acde6403eebaab4bc2eef7d995ed042b3c;p=gnulib.git diff --git a/lib/sig2str.c b/lib/sig2str.c index 4096465dd..cf2819daa 100644 --- a/lib/sig2str.c +++ b/lib/sig2str.c @@ -1,6 +1,6 @@ /* 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 it under the terms of the GNU General Public License as published by @@ -14,13 +14,11 @@ 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. */ + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ -#if HAVE_CONFIG_H -# include -#endif +#include #include #include @@ -28,10 +26,6 @@ #include #include -#if HAVE_SYS_WAIT_H -# include -#endif - #include "sig2str.h" #ifndef SIGRTMIN @@ -251,13 +245,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: - - 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 - 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. */ -#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. */ @@ -274,7 +268,7 @@ str2signum (char const *signame) } 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; @@ -319,7 +313,7 @@ str2sig (char const *signame, int *signum) int sig2str (int signum, char *signame) { - int i; + unsigned int i; for (i = 0; i < NUMNAME_ENTRIES; i++) if (numname_table[i].num == signum) {