Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)

This commit is contained in:
Denis Vlasenko
2007-06-25 10:55:35 +00:00
parent 1399282b47
commit 80b8b39899
26 changed files with 55 additions and 66 deletions

View File

@ -596,7 +596,7 @@ static const char * const signame[] = {
"Terminated",
};
#define NSIGNAL (sizeof(signame)/sizeof(signame[0]))
struct res {
const char *r_name;
@ -2997,7 +2997,7 @@ static int waitfor(int lastpid, int canintr)
} else {
rv = WAITSIG(s);
if (rv != 0) {
if (rv < NSIGNAL) {
if (rv < ARRAY_SIZE(signame)) {
if (signame[rv] != NULL) {
if (pid != lastpid) {
prn(pid);
@ -3016,7 +3016,7 @@ static int waitfor(int lastpid, int canintr)
}
if (WAITCORE(s))
prs(" - core dumped");
if (rv >= NSIGNAL || signame[rv])
if (rv >= ARRAY_SIZE(signame) || signame[rv])
prs("\n");
rv = -1;
} else