From 45dc614f057489b5eb05e438e1fd8f4d5dcd8b03 Mon Sep 17 00:00:00 2001 From: danblooomberg Date: Sun, 11 Dec 2022 12:22:58 -0800 Subject: [PATCH] Issue #655: Remove three unused variables in src --- src/numafunc2.c | 4 +--- src/pix4.c | 4 +--- src/pixafunc2.c | 10 +++------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/numafunc2.c b/src/numafunc2.c index f1fe151b9..967159b94 100644 --- a/src/numafunc2.c +++ b/src/numafunc2.c @@ -1739,7 +1739,7 @@ numaDiscretizeHistoInBins(NUMA *na, { NUMA *nabinval; /* average gray value in the bins */ NUMA *naeach, *nan; -l_int32 i, j, k, nxvals, occup, count, bincount, binindex, binsize; +l_int32 i, j, nxvals, occup, count, bincount, binindex, binsize; l_float32 sum, ave, ntot; if (pnarank) *pnarank = NULL; @@ -1766,11 +1766,9 @@ l_float32 sum, ave, ntot; binindex = 0; numaGetIValue(naeach, 0, &binsize); nabinval = numaCreate(nbins); - k = 0; /* count up to ntot */ for (i = 0; i < nxvals; i++) { numaGetIValue(na, i, &count); for (j = 0; j < count; j++) { - k++; bincount++; sum += i; if (bincount == binsize) { /* add bin entry */ diff --git a/src/pix4.c b/src/pix4.c index f4454b1b6..c159b4ac4 100644 --- a/src/pix4.c +++ b/src/pix4.c @@ -2649,7 +2649,7 @@ pixGetBinnedColor(PIX *pixs, l_uint32 **pcarray, PIXA *pixadb) { -l_int32 i, j, k, w, h, wpls, wplg; +l_int32 i, j, w, h, wpls, wplg; l_int32 count, bincount, binindex, binsize, npts, avepts, ntot; l_int32 rval, gval, bval, grayval, rave, gave, bave; l_uint32 *datas, *datag, *lines, *lineg, *carray; @@ -2734,11 +2734,9 @@ PIX *pix1; bincount = 0; binindex = 0; numaGetIValue(naeach, 0, &binsize); - k = 0; /* count up to ntot */ for (i = 0; i < 256; i++) { count = l_dnaaGetDnaCount(daa, i); for (j = 0; j < count; j++) { - k++; bincount++; l_dnaaGetValue(daa, i, j, &val64); extractRGBValues((l_uint32)val64, &rval, &gval, &bval); diff --git a/src/pixafunc2.c b/src/pixafunc2.c index 3807008ab..ccd38ba2e 100644 --- a/src/pixafunc2.c +++ b/src/pixafunc2.c @@ -344,7 +344,7 @@ pixaDisplayLinearly(PIXA *pixas, l_int32 border, BOXA **pboxa) { -l_int32 i, n, x, y, w, h, size, depth, bordval; +l_int32 i, n, x, y, w, h, depth, bordval; BOX *box; PIX *pix1, *pix2, *pix3, *pixd; PIXA *pixa1, *pixa2; @@ -363,7 +363,6 @@ PIXA *pixa1, *pixa2; n = pixaGetCount(pixa1); pixa2 = pixaCreate(n); bordval = (depth == 1) ? 1 : 0; - size = (n - 1) * spacing; x = y = 0; for (i = 0; i < n; i++) { if ((pix1 = pixaGetPix(pixa1, i, L_CLONE)) == NULL) { @@ -382,13 +381,10 @@ PIXA *pixa1, *pixa2; pixGetDimensions(pix3, &w, &h, NULL); box = boxCreate(x, y, w, h); - if (direction == L_HORIZ) { - size += w; + if (direction == L_HORIZ) x += w + spacing; - } else { /* vertical */ - size += h; + else /* vertical */ y += h + spacing; - } pixaAddPix(pixa2, pix3, L_INSERT); pixaAddBox(pixa2, box, L_INSERT); pixDestroy(&pix1);