Skip to content

Commit 2c23e7e

Browse files
committed
scanedg: Add const attributes
Signed-off-by: Stefan Weil <[email protected]>
1 parent 9551c3d commit 2c23e7e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/textord/scanedg.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void block_edges(Pix *t_pix, // thresholded image
5757

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

60-
uint8_t margin = WHITE_PIX;
60+
const uint8_t margin = WHITE_PIX;
6161

6262
for (int y = tright.y() - 1; y >= bleft.y() - 1; y--) {
6363
if (y >= bleft.y() && y < tright.y()) {
@@ -149,7 +149,6 @@ void line_edges(int16_t x, // coord of line start
149149
C_OUTLINE_IT* outline_it) {
150150
CrackPos pos = {free_cracks, x, y };
151151
int xmax; // max x coord
152-
int colour; // of current pixel
153152
int prevcolour; // of previous pixel
154153
CRACKEDGE *current; // current h edge
155154
CRACKEDGE *newcurrent; // new h edge
@@ -160,7 +159,7 @@ void line_edges(int16_t x, // coord of line start
160159

161160
// do each pixel
162161
for (; pos.x < xmax; pos.x++, prevline++) {
163-
colour = *bwpos++; // current pixel
162+
const int colour = *bwpos++; // current pixel
164163
if (*prevline != nullptr) {
165164
// changed above
166165
// change colour

0 commit comments

Comments
 (0)