--- ray/src/common/savqstr.c 2003/07/17 09:21:29 2.7 +++ ray/src/common/savqstr.c 2012/06/01 19:17:17 2.10 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: savqstr.c,v 2.7 2003/07/17 09:21:29 schorsch Exp $"; +static const char RCSid[] = "$Id: savqstr.c,v 2.10 2012/06/01 19:17:17 greg Exp $"; #endif /* * Save unshared strings. @@ -11,16 +11,16 @@ static const char RCSid[] = "$Id: savqstr.c,v 2.7 2003 #include +#include "rtio.h" #include "rterror.h" #if 1 char * -savqstr(s) /* save a private string */ -register char *s; +savqstr(char *s) /* save a private string */ { - register char *cp; + char *cp; char *newp; for (cp = s; *cp++; ) /* compute strlen()+1 */ @@ -30,15 +30,14 @@ register char *s; eputs("out of memory in savqstr"); quit(1); } - for (cp = newp; *cp++ = *s++; ) /* inline strcpy() */ + for (cp = newp; (*cp++ = *s++); ) /* inline strcpy() */ ; return(newp); /* return new location */ } void -freeqstr(s) /* free a private string */ -char *s; +freeqstr(char *s) /* free a private string */ { if (s != NULL) free((void *)s); @@ -51,6 +50,8 @@ char *s; * large blocks to optimize paging in VM environments. */ +#include "rtmisc.h" + #ifdef SMLMEM #ifndef MINBLOCK #define MINBLOCK (1<<10) /* minimum allocation block size */ @@ -67,18 +68,15 @@ char *s; #endif #endif -extern char *bmalloc(); - char * -savqstr(s) /* save a private string */ -register char *s; +savqstr(char *s) /* save a private string */ { static char *curp = NULL; /* allocated memory pointer */ static unsigned nrem = 0; /* bytes remaining in block */ static unsigned nextalloc = MINBLOCK; /* next block size */ - register char *cp; - register unsigned n; + char *cp; + unsigned n; for (cp = s; *cp++; ) /* compute strlen()+1 */ ; @@ -103,8 +101,7 @@ register char *s; void -freeqstr(s) /* free a private string (not recommended) */ -char *s; +freeqstr(char *s) /* free a private string (not recommended) */ { bfree(s, strlen(s)+1); }