Skip to content

Commit

Permalink
Issue #655: Remove three unused variables in src
Browse files Browse the repository at this point in the history
  • Loading branch information
DanBloomberg committed Dec 11, 2022
1 parent ffca513 commit 45dc614
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/numafunc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down
4 changes: 1 addition & 3 deletions src/pix4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 3 additions & 7 deletions src/pixafunc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 45dc614

Please sign in to comment.