pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/libfetch/files Fix some lint warnings about G/C un...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b0322820d3c1
branches:  trunk
changeset: 397419:b0322820d3c1
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Aug 11 20:48:06 2009 +0000

description:
Fix some lint warnings about G/C unused variables and changing a
variable type to match the return type of fetch_read.

diffstat:

 net/libfetch/files/common.c |  10 +++++-----
 net/libfetch/files/fetch.c  |  10 +---------
 2 files changed, 6 insertions(+), 14 deletions(-)

diffs (88 lines):

diff -r 94c2e9b28bd4 -r b0322820d3c1 net/libfetch/files/common.c
--- a/net/libfetch/files/common.c       Tue Aug 11 20:40:18 2009 +0000
+++ b/net/libfetch/files/common.c       Tue Aug 11 20:48:06 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.18 2009/02/22 19:11:48 joerg Exp $        */
+/*     $NetBSD: common.c,v 1.19 2009/08/11 20:48:06 joerg Exp $        */
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -261,17 +261,17 @@
 fetch_bind(int sd, int af, const char *addr)
 {
        struct addrinfo hints, *res, *res0;
-       int error;
 
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = af;
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_protocol = 0;
-       if ((error = getaddrinfo(addr, NULL, &hints, &res0)) != 0)
+       if (getaddrinfo(addr, NULL, &hints, &res0))
                return (-1);
-       for (res = res0; res; res = res->ai_next)
+       for (res = res0; res; res = res->ai_next) {
                if (bind(sd, res->ai_addr, res->ai_addrlen) == 0)
                        return (0);
+       }
        return (-1);
 }
 
@@ -614,7 +614,7 @@
 fetch_putln(conn_t *conn, const char *str, size_t len)
 {
        struct iovec iov[2];
-       int ret;
+       ssize_t ret;
 
        iov[0].iov_base = DECONST(char *, str);
        iov[0].iov_len = len;
diff -r 94c2e9b28bd4 -r b0322820d3c1 net/libfetch/files/fetch.c
--- a/net/libfetch/files/fetch.c        Tue Aug 11 20:40:18 2009 +0000
+++ b/net/libfetch/files/fetch.c        Tue Aug 11 20:48:06 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.18 2009/02/05 23:29:14 joerg Exp $ */
+/*     $NetBSD: fetch.c,v 1.19 2009/08/11 20:48:06 joerg Exp $ */
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -80,9 +80,7 @@
 fetchIO *
 fetchXGet(struct url *URL, struct url_stat *us, const char *flags)
 {
-       int direct;
 
-       direct = CHECK_FLAG('d');
        if (us != NULL) {
                us->size = -1;
                us->atime = us->mtime = 0;
@@ -116,9 +114,7 @@
 fetchIO *
 fetchPut(struct url *URL, const char *flags)
 {
-       int direct;
 
-       direct = CHECK_FLAG('d');
        if (strcasecmp(URL->scheme, SCHEME_FILE) == 0)
                return (fetchPutFile(URL, flags));
        else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0)
@@ -138,9 +134,7 @@
 int
 fetchStat(struct url *URL, struct url_stat *us, const char *flags)
 {
-       int direct;
 
-       direct = CHECK_FLAG('d');
        if (us != NULL) {
                us->size = -1;
                us->atime = us->mtime = 0;
@@ -165,9 +159,7 @@
 fetchList(struct url_list *ue, struct url *URL, const char *pattern,
     const char *flags)
 {
-       int direct;
 
-       direct = CHECK_FLAG('d');
        if (strcasecmp(URL->scheme, SCHEME_FILE) == 0)
                return (fetchListFile(ue, URL, pattern, flags));
        else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0)



Home | Main Index | Thread Index | Old Index