second set of ANSI C changes: C89-style function declarations, more inline functions, remove register keyword

This commit is contained in:
Chet Ramey
2023-01-03 10:23:11 -05:00
parent 81e3a4fb07
commit a61ffa78ed
85 changed files with 2867 additions and 5479 deletions
+20 -38
View File
@@ -246,8 +246,7 @@ static char *conv_buf;
static size_t conv_bufsize;
int
printf_builtin (list)
WORD_LIST *list;
printf_builtin (WORD_LIST *list)
{
int ch, fieldwidth, precision;
int have_fieldwidth, have_precision, use_Lmod, altform;
@@ -750,20 +749,19 @@ printf_builtin (list)
}
static void
printf_erange (s)
char *s;
printf_erange (char *s)
{
builtin_error (_("warning: %s: %s"), s, strerror(ERANGE));
}
/* We duplicate a lot of what printf(3) does here. */
/* FMT: format
STRING: expanded string argument
LEN: length of expanded string
FIELDWIDTH: argument for width of `*'
PRECISION: argument for precision of `*' */
static int
printstr (fmt, string, len, fieldwidth, precision)
char *fmt; /* format */
char *string; /* expanded string argument */
int len; /* length of expanded string */
int fieldwidth; /* argument for width of `*' */
int precision; /* argument for precision of `*' */
printstr (char *fmt, char *string, int len, int fieldwidth, int precision)
{
#if 0
char *s;
@@ -884,10 +882,7 @@ printstr (fmt, string, len, fieldwidth, precision)
do the \c short-circuiting, and \c is treated as an unrecognized escape
sequence; we also bypass the other processing specific to %b arguments. */
static int
tescape (estart, cp, lenp, sawc)
char *estart;
char *cp;
int *lenp, *sawc;
tescape (char *estart, char *cp, int *lenp, int *sawc)
{
register char *p;
int temp, c, evalue;
@@ -1001,9 +996,7 @@ tescape (estart, cp, lenp, sawc)
}
static char *
bexpand (string, len, sawc, lenp)
char *string;
int len, *sawc, *lenp;
bexpand (char *string, int len, int *sawc, int *lenp)
{
int temp;
char *ret, *r, *s, c;
@@ -1061,9 +1054,7 @@ bexpand (string, len, sawc, lenp)
}
static char *
vbadd (buf, blen)
char *buf;
int blen;
vbadd (char *buf, int blen)
{
size_t nlen;
@@ -1092,13 +1083,7 @@ vbadd (buf, blen)
}
static int
#if defined (PREFER_STDARG)
vbprintf (const char *format, ...)
#else
vbprintf (format, va_alist)
const char *format;
va_dcl
#endif
{
va_list args;
size_t nlen;
@@ -1130,10 +1115,7 @@ vbprintf (format, va_alist)
}
static char *
mklong (str, modifiers, mlen)
char *str;
char *modifiers;
size_t mlen;
mklong (char *str, char *modifiers, size_t mlen)
{
size_t len, slen;
@@ -1155,7 +1137,7 @@ mklong (str, modifiers, mlen)
}
static int
getchr ()
getchr (void)
{
int ret;
@@ -1168,7 +1150,7 @@ getchr ()
}
static char *
getstr ()
getstr (void)
{
char *ret;
@@ -1181,7 +1163,7 @@ getstr ()
}
static int
getint ()
getint (void)
{
intmax_t ret;
@@ -1205,7 +1187,7 @@ getint ()
}
static intmax_t
getintmax ()
getintmax (void)
{
intmax_t ret;
char *ep;
@@ -1240,7 +1222,7 @@ getintmax ()
}
static uintmax_t
getuintmax ()
getuintmax (void)
{
uintmax_t ret;
char *ep;
@@ -1271,7 +1253,7 @@ getuintmax ()
}
static double
getdouble ()
getdouble (void)
{
double ret;
char *ep;
@@ -1298,7 +1280,7 @@ getdouble ()
}
static floatmax_t
getfloatmax ()
getfloatmax (void)
{
floatmax_t ret;
char *ep;
@@ -1330,7 +1312,7 @@ getfloatmax ()
/* NO check is needed for garglist here. */
static intmax_t
asciicode ()
asciicode (void)
{
register intmax_t ch;
#if defined (HANDLE_MULTIBYTE)