Skip to content

Commit

Permalink
scanedg: Add const attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed May 26, 2019
1 parent 9551c3d commit 2c23e7e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/textord/scanedg.cpp
Expand Up @@ -57,7 +57,7 @@ void block_edges(Pix *t_pix, // thresholded image

std::unique_ptr<uint8_t[]> bwline(new uint8_t[width]);

uint8_t margin = WHITE_PIX;
const uint8_t margin = WHITE_PIX;

for (int y = tright.y() - 1; y >= bleft.y() - 1; y--) {
if (y >= bleft.y() && y < tright.y()) {
Expand Down Expand Up @@ -149,7 +149,6 @@ void line_edges(int16_t x, // coord of line start
C_OUTLINE_IT* outline_it) {
CrackPos pos = {free_cracks, x, y };
int xmax; // max x coord
int colour; // of current pixel
int prevcolour; // of previous pixel
CRACKEDGE *current; // current h edge
CRACKEDGE *newcurrent; // new h edge
Expand All @@ -160,7 +159,7 @@ void line_edges(int16_t x, // coord of line start

// do each pixel
for (; pos.x < xmax; pos.x++, prevline++) {
colour = *bwpos++; // current pixel
const int colour = *bwpos++; // current pixel
if (*prevline != nullptr) {
// changed above
// change colour
Expand Down

0 comments on commit 2c23e7e

Please sign in to comment.