Nuke register keyword usage, #if -> #ifdef, and avoid void *

arithmetic.

Obtained from: NetBSD
This commit is contained in:
Steve Price 1997-04-28 03:14:04 +00:00
parent 4ca7fe3b96
commit 7e461ef4f3
2 changed files with 13 additions and 13 deletions

View file

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: mknodes.c,v 1.7 1997/02/22 13:58:36 peter Exp $
*/
#ifndef lint
@ -54,7 +54,7 @@ static char const sccsid[] = "@(#)mknodes.c 8.2 (Berkeley) 5/4/95";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if __STDC__
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
@ -312,7 +312,7 @@ outfunc(cfile, calcsize)
fputs(" funcblocksize += nodesize[n->type];\n", cfile);
else {
fputs(" new = funcblock;\n", cfile);
fputs(" funcblock += nodesize[n->type];\n", cfile);
fputs(" funcblock = (char *)funcblock + nodesize[n->type];\n", cfile);
}
fputs(" switch (n->type) {\n", cfile);
for (sp = str ; sp < &str[nstr] ; sp++) {
@ -394,7 +394,7 @@ static int
nextfield(buf)
char *buf;
{
register char *p, *q;
char *p, *q;
p = linep;
while (*p == ' ' || *p == '\t')
@ -419,7 +419,7 @@ skipbl()
static int
readline()
{
register char *p;
char *p;
if (fgets(line, 1024, infp) == NULL)
return 0;
@ -437,7 +437,7 @@ readline()
static void
#if __STDC__
#ifdef __STDC__
error(const char *msg, ...)
#else
error(va_alist)
@ -445,7 +445,7 @@ error(va_alist)
#endif
{
va_list va;
#if __STDC__
#ifdef __STDC__
va_start(va, msg);
#else
char *msg;
@ -468,7 +468,7 @@ static char *
savestr(s)
const char *s;
{
register char *p;
char *p;
if ((p = malloc(strlen(s) + 1)) == NULL)
error("Out of space");

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nodes.c.pat 8.2 (Berkeley) 5/4/95
* $Id$
* $Id: nodes.c.pat,v 1.5 1997/02/22 13:58:39 peter Exp $
*/
#include <stdlib.h>
@ -79,7 +79,7 @@ copyfunc(n)
funcstringsize = 0;
calcsize(n);
funcblock = ckmalloc(funcblocksize + funcstringsize);
funcstring = funcblock + funcblocksize;
funcstring = (char *)funcblock + funcblocksize;
return copynode(n);
}
@ -128,7 +128,7 @@ copynodelist(lp)
lpp = &start;
while (lp) {
*lpp = funcblock;
funcblock += ALIGN(sizeof(struct nodelist));
funcblock = (char *)funcblock + ALIGN(sizeof(struct nodelist));
(*lpp)->n = copynode(lp->n);
lp = lp->next;
lpp = &(*lpp)->next;
@ -143,8 +143,8 @@ STATIC char *
nodesavestr(s)
char *s;
{
register char *p = s;
register char *q = funcstring;
char *p = s;
char *q = funcstring;
char *rtn = funcstring;
while ((*q++ = *p++) != '\0')