diff options
author | mikeh <mikeh@FreeBSD.org> | 2001-05-27 20:26:22 +0000 |
---|---|---|
committer | mikeh <mikeh@FreeBSD.org> | 2001-05-27 20:26:22 +0000 |
commit | aa40e2eac7ab213ab193707b4dec5e4bb0a8325b (patch) | |
tree | 35781af5ff6a267c8e45e7cc6091e7df70c229ce /usr.bin/mail/strings.c | |
parent | 83f67b8f31f7864baf3998922833c641684ff0f0 (diff) | |
download | FreeBSD-src-aa40e2eac7ab213ab193707b4dec5e4bb0a8325b.zip FreeBSD-src-aa40e2eac7ab213ab193707b4dec5e4bb0a8325b.tar.gz |
Cleanup mail(1)'s varying styles by converting to using style(9).
Also take a stab at cleaning up BDECFLAGS and convert all uses of
NOSTR, NIL, NONE, NOVAR, NOGRP, NOGE to NULL. Also kill 'register' to
get diffs somewhat closer to OpenBSD/NetBSD.
There are no functional changes however.
Reviewed by: nra (visual inspection)
Diffstat (limited to 'usr.bin/mail/strings.c')
-rw-r--r-- | usr.bin/mail/strings.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/usr.bin/mail/strings.c b/usr.bin/mail/strings.c index 08626d9..684a6d1 100644 --- a/usr.bin/mail/strings.c +++ b/usr.bin/mail/strings.c @@ -62,17 +62,16 @@ char * salloc(size) int size; { - register char *t; - register int s; - register struct strings *sp; - int index; + char *t; + int s, index; + struct strings *sp; s = size; - s += (sizeof (char *) - 1); - s &= ~(sizeof (char *) - 1); + s += (sizeof(char *) - 1); + s &= ~(sizeof(char *) - 1); index = 0; for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) { - if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s) + if (sp->s_topFree == NULL && (STRINGSIZE << index) >= s) break; if (sp->s_nleft >= s) break; @@ -80,9 +79,9 @@ salloc(size) } if (sp >= &stringdope[NSPACE]) errx(1, "String too large"); - if (sp->s_topFree == NOSTR) { + if (sp->s_topFree == NULL) { index = sp - &stringdope[0]; - if ((sp->s_topFree = malloc(STRINGSIZE << index)) == NOSTR) + if ((sp->s_topFree = malloc(STRINGSIZE << index)) == NULL) err(1, "No room for space %d", index); sp->s_nextFree = sp->s_topFree; sp->s_nleft = STRINGSIZE << index; @@ -90,7 +89,7 @@ salloc(size) sp->s_nleft -= s; t = sp->s_nextFree; sp->s_nextFree += s; - return(t); + return (t); } /* @@ -101,14 +100,14 @@ salloc(size) void sreset() { - register struct strings *sp; - register int index; + struct strings *sp; + int index; if (noreset) return; index = 0; for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) { - if (sp->s_topFree == NOSTR) + if (sp->s_topFree == NULL) continue; sp->s_nextFree = sp->s_topFree; sp->s_nleft = STRINGSIZE << index; @@ -123,8 +122,8 @@ sreset() void spreserve() { - register struct strings *sp; + struct strings *sp; for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) - sp->s_topFree = NOSTR; + sp->s_topFree = NULL; } |