summaryrefslogtreecommitdiff
path: root/archival/libarchive
diff options
context:
space:
mode:
authorDenys Vlasenko2013-11-29 16:43:33 +0100
committerDenys Vlasenko2013-11-29 16:43:33 +0100
commit9b2a9f0210f13f1c59c0b954c4aa0eeb0a66efd1 (patch)
treea950fa73740d345e11ba1ce90f4fc39ee12516e6 /archival/libarchive
parent1a7256ac38284caffd2a0de2250364369059be69 (diff)
downloadbusybox-9b2a9f0210f13f1c59c0b954c4aa0eeb0a66efd1.zip
busybox-9b2a9f0210f13f1c59c0b954c4aa0eeb0a66efd1.tar.gz
fix assorted unused code and wrong format specs found by cppchekc (bug 6716)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive')
-rw-r--r--archival/libarchive/bz/compress.c4
-rw-r--r--archival/libarchive/decompress_bunzip2.c1
-rw-r--r--archival/libarchive/decompress_gunzip.c2
-rw-r--r--archival/libarchive/lzo1x_9x.c1
4 files changed, 2 insertions, 6 deletions
diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c
index a7dd72d..23de9d3 100644
--- a/archival/libarchive/bz/compress.c
+++ b/archival/libarchive/bz/compress.c
@@ -249,7 +249,7 @@ void generateMTFValues(EState* s)
static NOINLINE
void sendMTFValues(EState* s)
{
- int32_t v, t, i, j, gs, ge, totc, bt, bc, iter;
+ int32_t v, t, i, j, gs, ge, bt, bc, iter;
int32_t nSelectors, alphaSize, minLen, maxLen, selCtr;
int32_t nGroups;
@@ -345,7 +345,6 @@ void sendMTFValues(EState* s)
}
#endif
nSelectors = 0;
- totc = 0;
gs = 0;
while (1) {
/*--- Set group start & end marks. --*/
@@ -411,7 +410,6 @@ void sendMTFValues(EState* s)
bt = t;
}
}
- totc += bc;
fave[bt]++;
s->selector[nSelectors] = bt;
nSelectors++;
diff --git a/archival/libarchive/decompress_bunzip2.c b/archival/libarchive/decompress_bunzip2.c
index fb1f292..6396fe4 100644
--- a/archival/libarchive/decompress_bunzip2.c
+++ b/archival/libarchive/decompress_bunzip2.c
@@ -818,7 +818,6 @@ static char *const bunzip_errors[] = {
/* Dumb little test thing, decompress stdin to stdout */
int main(int argc, char **argv)
{
- int i;
char c;
int i = unpack_bz2_stream(0, 1);
diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
index 4e6b138..7c6f38e 100644
--- a/archival/libarchive/decompress_gunzip.c
+++ b/archival/libarchive/decompress_gunzip.c
@@ -336,7 +336,7 @@ static int huft_build(const unsigned *b, const unsigned n,
}
/* Find minimum and maximum length, bound *m by those */
- for (j = 1; (c[j] == 0) && (j <= BMAX); j++)
+ for (j = 1; (j <= BMAX) && (c[j] == 0); j++)
continue;
k = j; /* minimum code length */
for (i = BMAX; (c[i] == 0) && i; i--)
diff --git a/archival/libarchive/lzo1x_9x.c b/archival/libarchive/lzo1x_9x.c
index 3e33198..2b490ae 100644
--- a/archival/libarchive/lzo1x_9x.c
+++ b/archival/libarchive/lzo1x_9x.c
@@ -466,7 +466,6 @@ static int find_match(lzo1x_999_t *c, lzo_swd_p s,
}
s->m_len = 1;
- s->m_len = 1;
#ifdef SWD_BEST_OFF
if (s->use_best_off)
memset(s->best_pos, 0, sizeof(s->best_pos));