Skip to content

Commit

Permalink
Fixed problem with a compiler bug
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@65 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
theraysmith committed May 17, 2007
1 parent 55f35dd commit d33938c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions textord/makerow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ void compute_line_occupation( //project blobs
) {
INT32 line_count; //maxy-miny+1
INT32 line_index; //of scan line
int index; //array index for daft compilers
float top, bottom; //coords of blob
INT32 width; //of blob
TO_ROW *row; //current row
Expand Down Expand Up @@ -816,13 +817,15 @@ void compute_line_occupation( //project blobs
"Bad y coord of bottom, " INT32FORMAT "(" INT32FORMAT ","
INT32FORMAT ")\n", (INT32) floor (bottom), min_y, max_y);
//count transitions
deltas[(INT32) floor (bottom) - min_y] += width;
index = (INT32) floor (bottom) - min_y;
deltas[index] += width;
if ((INT32) floor (top) < min_y
|| (INT32) floor (top) - min_y >= line_count)
fprintf (stderr,
"Bad y coord of top, " INT32FORMAT "(" INT32FORMAT ","
INT32FORMAT ")\n", (INT32) floor (top), min_y, max_y);
deltas[(INT32) floor (top) - min_y] -= width;
index = (INT32) floor (top) - min_y;
deltas[index] -= width;
}
}
occupation[0] = deltas[0];
Expand Down

0 comments on commit d33938c

Please sign in to comment.