diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-11-11 21:01:00 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-11-11 21:01:00 +0000 |
commit | 16043b208195fe60c8a42da84278afe176951710 (patch) | |
tree | 86880f366402cfab5f0e791c73ff5ced4ec495b8 | |
parent | 7aa463e937770b401d6ad4a98e66cc789c9b7a6b (diff) |
Nuke dead assignments and a dead function, from Michael W Bombardieri
using lint.
-rw-r--r-- | usr.bin/cvs/add.c | 5 | ||||
-rw-r--r-- | usr.bin/cvs/rcs.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/util.c | 25 | ||||
-rw-r--r-- | usr.bin/cvs/util.h | 3 |
4 files changed, 7 insertions, 32 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index d72df948ce0..46cde4557dc 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.109 2010/07/23 21:46:04 ray Exp $ */ +/* $OpenBSD: add.c,v 1.110 2010/11/11 21:00:59 nicm Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -232,7 +232,6 @@ cvs_add_tobranch(struct cvs_file *cf, char *tag) char attic[MAXPATHLEN], repo[MAXPATHLEN]; char *msg; struct stat st; - struct rcs_delta *rdp; RCSNUM *branch; cvs_log(LP_TRACE, "cvs_add_tobranch(%s)", cf->file_name); @@ -280,7 +279,7 @@ cvs_add_tobranch(struct cvs_file *cf, char *tag) "revision"); xfree(msg); - if ((rdp = rcs_findrev(cf->file_rcs, cf->file_rcs->rf_head)) == NULL) + if (rcs_findrev(cf->file_rcs, cf->file_rcs->rf_head) == NULL) fatal("cvs_add_tobranch: cannot find newly added revision"); bp = buf_alloc(1); diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index fa8ff39cdd0..82e033dc05d 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.307 2010/10/31 15:37:34 nicm Exp $ */ +/* $OpenBSD: rcs.c,v 1.308 2010/11/11 21:00:59 nicm Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1063,7 +1063,7 @@ rcs_delta_stats(struct rcs_delta *rdp, int *ladded, int *lremoved) { struct rcs_lines *plines; struct rcs_line *lp; - int added, i, lineno, nbln, removed; + int added, i, nbln, removed; char op, *ep; u_char tmp; @@ -1081,7 +1081,7 @@ rcs_delta_stats(struct rcs_delta *rdp, int *ladded, int *lremoved) /* NUL-terminate line buffer for strtol() safety. */ tmp = lp->l_line[lp->l_len - 1]; lp->l_line[lp->l_len - 1] = '\0'; - lineno = (int)strtol((lp->l_line + 1), &ep, 10); + (void)strtol((lp->l_line + 1), &ep, 10); ep++; nbln = (int)strtol(ep, &ep, 10); /* Restore the last byte of the buffer */ diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index 28f5a458029..b27b5bd4e49 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.153 2010/09/23 18:10:16 nicm Exp $ */ +/* $OpenBSD: util.c,v 1.154 2010/11/11 21:00:59 nicm Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org> @@ -200,29 +200,6 @@ cvs_modetostr(mode_t mode, char *buf, size_t len) } /* - * cvs_cksum() - * - * Calculate the MD5 checksum of the file whose path is <file> and generate - * a CVS-format 32 hex-digit string, which is stored in <dst>, whose size is - * given in <len> and must be at least 33. - * Returns 0 on success, or -1 on failure. - */ -int -cvs_cksum(const char *file, char *dst, size_t len) -{ - if (len < CVS_CKSUM_LEN) { - cvs_log(LP_ERR, "buffer too small for checksum"); - return (-1); - } - if (MD5File(file, dst) == NULL) { - cvs_log(LP_ERR, "failed to generate checksum for %s", file); - return (-1); - } - - return (0); -} - -/* * cvs_getargv() * * Parse a line contained in <line> and generate an argument vector by diff --git a/usr.bin/cvs/util.h b/usr.bin/cvs/util.h index e80b2ce4620..bf2dc284b53 100644 --- a/usr.bin/cvs/util.h +++ b/usr.bin/cvs/util.h @@ -1,4 +1,4 @@ -/* $OpenBSD: util.h,v 1.29 2010/09/23 18:10:16 nicm Exp $ */ +/* $OpenBSD: util.h,v 1.30 2010/11/11 21:00:59 nicm Exp $ */ /* * Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -34,7 +34,6 @@ void cvs_strtomode(const char *, mode_t *); void cvs_mkadmin(const char *, const char *, const char *, char *, char *); void cvs_mkpath(const char *, char *); void cvs_mkdir(const char *, mode_t); -int cvs_cksum(const char *, char *, size_t); int cvs_getargv(const char *, char **, int); int cvs_chdir(const char *, int); int cvs_rename(const char *, const char *); |