Module Name:    src
Committed By:   christos
Date:           Sat Jun 25 20:27:02 UTC 2011

Modified Files:
        src/external/bsd/fetch/dist/libfetch: common.c file.c ftp.c http.c

Log Message:
delint


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/bsd/fetch/dist/libfetch/common.c
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/bsd/fetch/dist/libfetch/file.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/fetch/dist/libfetch/ftp.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/fetch/dist/libfetch/http.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/fetch/dist/libfetch/common.c
diff -u src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.9 src/external/bsd/fetch/dist/libfetch/common.c:1.2
--- src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.9	Wed Mar 24 16:51:41 2010
+++ src/external/bsd/fetch/dist/libfetch/common.c	Sat Jun 25 16:27:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.1.1.9 2010/03/24 20:51:41 joerg Exp $	*/
+/*	$NetBSD: common.c,v 1.2 2011/06/25 20:27:01 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
  * Copyright (c) 2008, 2010 Joerg Sonnenberger <[email protected]>
@@ -539,7 +539,7 @@
 		}
 #ifdef WITH_SSL
 		if (conn->ssl != NULL)
-			rlen = SSL_read(conn->ssl, buf, len);
+			rlen = SSL_read(conn->ssl, buf, (int)len);
 		else
 #endif
 			rlen = read(conn->sd, buf, len);
@@ -588,7 +588,7 @@
 			return (-1);
 		if (len == 0)
 			break;
-		next = memchr(conn->buf + conn->buflen, '\n', len);
+		next = memchr(conn->buf + conn->buflen, '\n', (size_t)len);
 		conn->buflen += len;
 		if (conn->buflen == conn->bufsize && next == NULL) {
 			tmp = conn->buf;
@@ -674,7 +674,7 @@
 		errno = 0;
 #ifdef WITH_SSL
 		if (conn->ssl != NULL)
-			wlen = SSL_write(conn->ssl, buf, len);
+			wlen = SSL_write(conn->ssl, buf, (int)len);
 		else
 #endif
 #ifndef MSG_NOSIGNAL

Index: src/external/bsd/fetch/dist/libfetch/file.c
diff -u src/external/bsd/fetch/dist/libfetch/file.c:1.1.1.6 src/external/bsd/fetch/dist/libfetch/file.c:1.2
--- src/external/bsd/fetch/dist/libfetch/file.c:1.1.1.6	Thu Oct 15 08:59:59 2009
+++ src/external/bsd/fetch/dist/libfetch/file.c	Sat Jun 25 16:27:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.1.1.6 2009/10/15 12:59:59 joerg Exp $	*/
+/*	$NetBSD: file.c,v 1.2 2011/06/25 20:27:01 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
  * Copyright (c) 2008, 2009 Joerg Sonnenberger <[email protected]>
@@ -204,7 +204,8 @@
 }
 
 int
-fetchStatFile(struct url *u, struct url_stat *us, const char *flags)
+/*ARGSUSED*/
+fetchStatFile(struct url *u, struct url_stat *us, const char *flags __unused)
 {
 	char *path;
 	int fd, rv;
@@ -229,7 +230,9 @@
 }
 
 int
-fetchListFile(struct url_list *ue, struct url *u, const char *pattern, const char *flags)
+/*ARGSUSED*/
+fetchListFile(struct url_list *ue, struct url *u, const char *pattern,
+    const char *flags __unused)
 {
 	char *path;
 	struct dirent *de;

Index: src/external/bsd/fetch/dist/libfetch/ftp.c
diff -u src/external/bsd/fetch/dist/libfetch/ftp.c:1.3 src/external/bsd/fetch/dist/libfetch/ftp.c:1.4
--- src/external/bsd/fetch/dist/libfetch/ftp.c:1.3	Sat Jun 25 16:13:03 2011
+++ src/external/bsd/fetch/dist/libfetch/ftp.c	Sat Jun 25 16:27:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp.c,v 1.3 2011/06/25 20:13:03 christos Exp $	*/
+/*	$NetBSD: ftp.c,v 1.4 2011/06/25 20:27:01 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
  * Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger <[email protected]>
@@ -202,7 +202,7 @@
 	va_list ap;
 	size_t len;
 	char *msg;
-	int r;
+	ssize_t r;
 
 	va_start(ap, fmt);
 	len = vasprintf(&msg, fmt, ap);
@@ -229,7 +229,7 @@
  * Return a pointer to the filename part of a path
  */
 static const char *
-ftp_filename(const char *file, int *len, int *type, int subdir)
+ftp_filename(const char *file, size_t *len, int *type, int subdir)
 {
 	const char *s;
 
@@ -256,6 +256,7 @@
 {
 	char *src, *dst, *end;
 	int q;
+	size_t len;
 
 	if (conn->err != FTP_WORKING_DIRECTORY &&
 	    conn->err != FTP_FILE_ACTION_OK)
@@ -264,7 +265,8 @@
 	src = conn->buf + 4;
 	if (src >= end || *src++ != '"')
 		return (FTP_PROTOCOL_ERROR);
-	*pwd = malloc(end - src + 1);
+	len = end - src + 1;
+	*pwd = malloc(len);
 	if (*pwd == NULL)
 		return (FTP_PROTOCOL_ERROR);
 	for (q = 0, dst = *pwd; src < end; ++src) {
@@ -295,7 +297,8 @@
 {
 	const char *beg, *end;
 	char *pwd, *dst;
-	int e, i, len;
+	int e;
+	size_t i, len;
 
 	if (*path != '/') {
 		ftp_seterr(501);
@@ -342,7 +345,7 @@
 		len = strlen(pwd);
 
 		/* Look for a common prefix between PWD and dir to fetch. */
-		for (i = 0; i <= len && i <= end - dst; ++i)
+		for (i = 0; i <= len && i <= (size_t)(end - dst); ++i)
 			if (pwd[i] != dst[i])
 				break;
 		/* Keep going up a dir until we have a matching prefix. */
@@ -409,6 +412,7 @@
 	case 0:
 	case 's':
 		mode = 'S';
+		/*FALLTHROUGH*/
 	case 'S':
 		break;
 	default:
@@ -437,14 +441,17 @@
 	case 0:
 	case 'i':
 		type = 'I';
+		/*FALLTHROUGH*/
 	case 'I':
 		break;
 	case 'a':
 		type = 'A';
+		/*FALLTHROUGH*/
 	case 'A':
 		break;
 	case 'd':
 		type = 'D';
+		/*FALLTHROUGH*/
 	case 'D':
 		/* can't handle yet */
 	default:
@@ -464,7 +471,8 @@
 {
 	char *ln;
 	const char *filename;
-	int filenamelen, type;
+	size_t filenamelen;
+	int type;
 	struct tm tm;
 	time_t t;
 	int e;
@@ -552,7 +560,7 @@
 ftp_readfn(void *v, void *buf, size_t len)
 {
 	struct ftpio *io;
-	int r;
+	ssize_t r;
 
 	io = (struct ftpio *)v;
 	if (io == NULL) {
@@ -585,7 +593,7 @@
 ftp_writefn(void *v, const void *buf, size_t len)
 {
 	struct ftpio *io;
-	int w;
+	ssize_t w;
 
 	io = (struct ftpio *)v;
 	if (io == NULL) {
@@ -619,7 +627,6 @@
 ftp_closefn(void *v)
 {
 	struct ftpio *io;
-	int r;
 
 	io = (struct ftpio *)v;
 	if (io == NULL) {
@@ -635,7 +642,7 @@
 	fetch_close(io->dconn);
 	io->dconn = NULL;
 	io->dir = -1;
-	r = ftp_chkerr(io->cconn);
+	(void)ftp_chkerr(io->cconn);
 	fetch_cache_put(io->cconn, ftp_disconnect);
 	free(io);
 	return;
@@ -676,7 +683,8 @@
 	} u;
 	const char *bindaddr;
 	const char *filename;
-	int filenamelen, type;
+	size_t filenamelen;
+	int type;
 	int low, pasv, verbose;
 	int e, sd = -1;
 	socklen_t l;
@@ -759,7 +767,7 @@
 			}
 			l = (e == FTP_PASSIVE_MODE ? 6 : 21);
 			for (i = 0; *p && i < l; i++, p++)
-				addr[i] = strtol(p, &p, 10);
+				addr[i] = (unsigned char)strtol(p, &p, 10);
 			if (i < l) {
 				e = FTP_PROTOCOL_ERROR;
 				goto ouch;
@@ -861,7 +869,7 @@
 #ifdef IPV6_PORTRANGE
 			arg = low ? IPV6_PORTRANGE_DEFAULT : IPV6_PORTRANGE_HIGH;
 			if (setsockopt(sd, IPPROTO_IPV6, IPV6_PORTRANGE,
-				(char *)&arg, sizeof(arg)) == -1)
+				&arg, (socklen_t)sizeof(arg)) == -1)
 				goto sysouch;
 #endif
 			break;
@@ -870,7 +878,7 @@
 #ifdef IP_PORTRANGE
 			arg = low ? IP_PORTRANGE_DEFAULT : IP_PORTRANGE_HIGH;
 			if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE,
-				(char *)&arg, sizeof(arg)) == -1)
+				&arg, (socklen_t)sizeof(arg)) == -1)
 				goto sysouch;
 #endif
 			break;
@@ -892,14 +900,14 @@
 			e = ftp_cmd(conn, "PORT %d,%d,%d,%d,%d,%d\r\n",
 			    (a >> 24) & 0xff, (a >> 16) & 0xff,
 			    (a >> 8) & 0xff, a & 0xff,
-			    (p >> 8) & 0xff, p & 0xff);
+			    ((unsigned int)p >> 8) & 0xff, p & 0xff);
 			break;
 		case AF_INET6:
 #define UC(b)	(((int)b)&0xff)
 			e = -1;
 			u.sin6.sin6_scope_id = 0;
 			if (getnameinfo(&u.sa, l,
-				hname, sizeof(hname),
+				hname, (socklen_t)sizeof(hname),
 				NULL, 0, NI_NUMERICHOST) == 0) {
 				e = ftp_cmd(conn, "EPRT |%d|%s|%d|\r\n", 2, hname,
 				    htons(u.sin6.sin6_port));
@@ -907,7 +915,7 @@
 					goto ouch;
 			}
 			if (e != FTP_OK) {
-				ap = (char *)&u.sin6.sin6_addr;
+				ap = (char *)(void *)&u.sin6.sin6_addr;
 				e = ftp_cmd(conn,
 				    "LPRT %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\r\n",
 				    6, 16,
@@ -916,7 +924,7 @@
 				    UC(ap[8]), UC(ap[9]), UC(ap[10]), UC(ap[11]),
 				    UC(ap[12]), UC(ap[13]), UC(ap[14]), UC(ap[15]),
 				    2,
-				    (ntohs(u.sin6.sin6_port) >> 8) & 0xff,
+				    ((unsigned int)ntohs(u.sin6.sin6_port) >> 8) & 0xff,
 				    ntohs(u.sin6.sin6_port)        & 0xff);
 			}
 			break;

Index: src/external/bsd/fetch/dist/libfetch/http.c
diff -u src/external/bsd/fetch/dist/libfetch/http.c:1.1.1.7 src/external/bsd/fetch/dist/libfetch/http.c:1.2
--- src/external/bsd/fetch/dist/libfetch/http.c:1.1.1.7	Sat Jan 30 16:26:14 2010
+++ src/external/bsd/fetch/dist/libfetch/http.c	Sat Jun 25 16:27:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: http.c,v 1.1.1.7 2010/01/30 21:26:14 joerg Exp $	*/
+/*	$NetBSD: http.c,v 1.2 2011/06/25 20:27:01 christos Exp $	*/
 /*-
  * Copyright (c) 2000-2004 Dag-Erling Co�dan Sm�rgrav
  * Copyright (c) 2003 Thomas Klausner <[email protected]>
@@ -146,7 +146,7 @@
 	char		*buf;		/* chunk buffer */
 	size_t		 bufsize;	/* size of chunk buffer */
 	ssize_t		 buflen;	/* amount of data currently in buffer */
-	int		 bufpos;	/* current read offset in buffer */
+	size_t		 bufpos;	/* current read offset in buffer */
 	int		 eof;		/* end-of-file flag */
 	int		 error;		/* error flag */
 	size_t		 chunksize;	/* remaining size of current chunk */
@@ -156,7 +156,7 @@
 /*
  * Get next chunk header
  */
-static int
+static ssize_t
 http_new_chunk(struct httpio *io)
 {
 	char *p;
@@ -205,7 +205,7 @@
 /*
  * Fill the input buffer, do chunk decoding on the fly
  */
-static int
+static ssize_t
 http_fillbuf(struct httpio *io, size_t len)
 {
 	if (io->error)
@@ -286,7 +286,7 @@
 
 	for (pos = 0; len > 0; pos += l, len -= l) {
 		/* empty buffer */
-		if (!io->buf || io->bufpos == io->buflen)
+		if (!io->buf || (ssize_t)io->bufpos == io->buflen)
 			if (http_fillbuf(io, len) < 1)
 				break;
 		l = io->buflen - io->bufpos;
@@ -325,7 +325,7 @@
 
 		val = 0;
 		setsockopt(io->conn->sd, IPPROTO_TCP, TCP_NODELAY, &val,
-			   sizeof(val));
+			   (socklen_t)sizeof(val));
 			  fetch_cache_put(io->conn, fetch_close);
 #ifdef TCP_NOPUSH
 		val = 1;
@@ -410,7 +410,7 @@
 	va_list ap;
 	size_t len;
 	char *msg;
-	int r;
+	ssize_t r;
 
 	va_start(ap, fmt);
 	len = vasprintf(&msg, fmt, ap);
@@ -604,7 +604,7 @@
 	    "0123456789+/";
 	char *str, *dst;
 	size_t l;
-	int t, r;
+	unsigned int t, r;
 
 	l = strlen(src);
 	if ((str = malloc(((l + 2) / 3) * 4 + 1)) == NULL)
@@ -962,7 +962,7 @@
 #endif
 		val = 1;
 		setsockopt(conn->sd, IPPROTO_TCP, TCP_NODELAY, &val,
-			   sizeof(val));
+		    (socklen_t)sizeof(val));
 
 		/* get reply */
 		switch (http_get_reply(conn)) {
@@ -1238,7 +1238,8 @@
  * Store a file by HTTP
  */
 fetchIO *
-fetchPutHTTP(struct url *URL, const char *flags)
+/*ARGSUSED*/
+fetchPutHTTP(struct url *URL __unused, const char *flags __unused)
 {
 	fprintf(stderr, "fetchPutHTTP(): not implemented\n");
 	return (NULL);
@@ -1430,7 +1431,8 @@
  * List a directory
  */
 int
-fetchListHTTP(struct url_list *ue, struct url *url, const char *pattern, const char *flags)
+/*ARGSUSED*/
+fetchListHTTP(struct url_list *ue, struct url *url, const char *pattern __unused, const char *flags)
 {
 	fetchIO *f;
 	char buf[2 * PATH_MAX];

Reply via email to