summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/interp_parse.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-08-03 09:14:02 +0000
committerjhb <jhb@FreeBSD.org>2000-08-03 09:14:02 +0000
commite165b852ded88acff34e4cb4f334647dcb33c319 (patch)
treea0d78fd9b77c781f88bf64107578f9e585421ff5 /sys/boot/common/interp_parse.c
parent1f9890b495e04d1e7d9e102fd9df269969c2885c (diff)
downloadFreeBSD-src-e165b852ded88acff34e4cb4f334647dcb33c319.zip
FreeBSD-src-e165b852ded88acff34e4cb4f334647dcb33c319.tar.gz
Cleanup warnings. Most of these are signed/unsigned warnings, as well as
some added const's.
Diffstat (limited to 'sys/boot/common/interp_parse.c')
-rw-r--r--sys/boot/common/interp_parse.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/boot/common/interp_parse.c b/sys/boot/common/interp_parse.c
index 0f83c43..c57001a 100644
--- a/sys/boot/common/interp_parse.c
+++ b/sys/boot/common/interp_parse.c
@@ -18,13 +18,11 @@
#include <stand.h>
#include <string.h>
+#include "bootstrap.h"
-/* Forward decls */
-extern char *backslash(char *str);
-
-static void clean(void);
-static int insert(int *argcp, char *buf);
-static char *variable_lookup(char *name);
+static void clean(void);
+static int insert(int *argcp, char *buf);
+static char *variable_lookup(char *name);
#define PARSE_BUFSIZE 1024 /* maximum size of one element */
#define MAXARGS 20 /* maximum number of elements */
@@ -61,7 +59,7 @@ if (expr) { \
/* Accept the usual delimiters for a variable, returning counterpart */
static char
-isdelim(char ch)
+isdelim(int ch)
{
if (ch == '{')
return '}';
@@ -71,7 +69,7 @@ isdelim(char ch)
}
static int
-isquote(char ch)
+isquote(int ch)
{
return (ch == '\'' || ch == '"');
}
@@ -81,7 +79,7 @@ parse(int *argc, char ***argv, char *str)
{
int ac;
char *val, *p, *q, *copy = NULL;
- int i = 0;
+ size_t i = 0;
char token, tmp, quote, *buf;
enum { STR, VAR, WHITE } state;
@@ -147,7 +145,7 @@ parse(int *argc, char ***argv, char *str)
tmp = *q;
*q = '\0';
if ((val = variable_lookup(p)) != NULL) {
- int len = strlen(val);
+ size_t len = strlen(val);
strncpy(buf + i, val, PARSE_BUFSIZE - (i + 1));
i += min(len, PARSE_BUFSIZE - 1);
OpenPOWER on IntegriCloud