mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Remove register attribute for local variables
This fixes clang compiler warnings like this one: wordrec/gradechop.cpp:52:3: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register] Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
479fe9c370
commit
83541d8ea0
@ -214,18 +214,18 @@ EDGEPT edgepts[] //output is array
|
|||||||
void fix2( //polygonal approx
|
void fix2( //polygonal approx
|
||||||
EDGEPT *start, /*loop to approimate */
|
EDGEPT *start, /*loop to approimate */
|
||||||
int area) {
|
int area) {
|
||||||
register EDGEPT *edgept; /*current point */
|
EDGEPT *edgept; /*current point */
|
||||||
register EDGEPT *edgept1;
|
EDGEPT *edgept1;
|
||||||
register EDGEPT *loopstart; /*modified start of loop */
|
EDGEPT *loopstart; /*modified start of loop */
|
||||||
register EDGEPT *linestart; /*start of line segment */
|
EDGEPT *linestart; /*start of line segment */
|
||||||
register int dir1, dir2; /*directions of line */
|
int dir1, dir2; /*directions of line */
|
||||||
register int sum1, sum2; /*lengths in dir1,dir2 */
|
int sum1, sum2; /*lengths in dir1,dir2 */
|
||||||
int stopped; /*completed flag */
|
int stopped; /*completed flag */
|
||||||
int fixed_count; //no of fixed points
|
int fixed_count; //no of fixed points
|
||||||
int d01, d12, d23, gapmin;
|
int d01, d12, d23, gapmin;
|
||||||
TPOINT d01vec, d12vec, d23vec;
|
TPOINT d01vec, d12vec, d23vec;
|
||||||
register EDGEPT *edgefix, *startfix;
|
EDGEPT *edgefix, *startfix;
|
||||||
register EDGEPT *edgefix0, *edgefix1, *edgefix2, *edgefix3;
|
EDGEPT *edgefix0, *edgefix1, *edgefix2, *edgefix3;
|
||||||
|
|
||||||
edgept = start; /*start of loop */
|
edgept = start; /*start of loop */
|
||||||
while (((edgept->flags[DIR] - edgept->prev->flags[DIR] + 1) & 7) < 3
|
while (((edgept->flags[DIR] - edgept->prev->flags[DIR] + 1) & 7) < 3
|
||||||
@ -400,10 +400,10 @@ EDGEPT *poly2( //second poly
|
|||||||
EDGEPT *startpt, /*start of loop */
|
EDGEPT *startpt, /*start of loop */
|
||||||
int area /*area of blob box */
|
int area /*area of blob box */
|
||||||
) {
|
) {
|
||||||
register EDGEPT *edgept; /*current outline point */
|
EDGEPT *edgept; /*current outline point */
|
||||||
EDGEPT *loopstart; /*starting point */
|
EDGEPT *loopstart; /*starting point */
|
||||||
register EDGEPT *linestart; /*start of line */
|
EDGEPT *linestart; /*start of line */
|
||||||
register int edgesum; /*correction count */
|
int edgesum; /*correction count */
|
||||||
|
|
||||||
if (area < 1200)
|
if (area < 1200)
|
||||||
area = 1200; /*minimum value */
|
area = 1200; /*minimum value */
|
||||||
@ -499,13 +499,13 @@ void cutline( //recursive refine
|
|||||||
EDGEPT *last,
|
EDGEPT *last,
|
||||||
int area /*area of object */
|
int area /*area of object */
|
||||||
) {
|
) {
|
||||||
register EDGEPT *edge; /*current edge */
|
EDGEPT *edge; /*current edge */
|
||||||
TPOINT vecsum; /*vector sum */
|
TPOINT vecsum; /*vector sum */
|
||||||
int vlen; /*approx length of vecsum */
|
int vlen; /*approx length of vecsum */
|
||||||
TPOINT vec; /*accumulated vector */
|
TPOINT vec; /*accumulated vector */
|
||||||
EDGEPT *maxpoint; /*worst point */
|
EDGEPT *maxpoint; /*worst point */
|
||||||
int maxperp; /*max deviation */
|
int maxperp; /*max deviation */
|
||||||
register int perp; /*perp distance */
|
int perp; /*perp distance */
|
||||||
int ptcount; /*no of points */
|
int ptcount; /*no of points */
|
||||||
int squaresum; /*sum of perps */
|
int squaresum; /*sum of perps */
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ int xpts[], //points to fit
|
|||||||
int ypts[], int pointcount, //no of pts
|
int ypts[], int pointcount, //no of pts
|
||||||
int degree //fit required
|
int degree //fit required
|
||||||
) {
|
) {
|
||||||
register int pointindex; /*no along text line */
|
int pointindex; /*no along text line */
|
||||||
register int segment; /*segment no */
|
int segment; /*segment no */
|
||||||
inT32 *ptcounts; //no in each segment
|
inT32 *ptcounts; //no in each segment
|
||||||
QLSQ qlsq; /*accumulator */
|
QLSQ qlsq; /*accumulator */
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ void QSPLINE::extrapolate( //linear extrapolation
|
|||||||
int xmin, //new left edge
|
int xmin, //new left edge
|
||||||
int xmax //new right edge
|
int xmax //new right edge
|
||||||
) {
|
) {
|
||||||
register int segment; /*current segment of spline */
|
int segment; /*current segment of spline */
|
||||||
int dest_segment; //dest index
|
int dest_segment; //dest index
|
||||||
int *xstarts; //new boundaries
|
int *xstarts; //new boundaries
|
||||||
QUAD_COEFFS *quads; //new ones
|
QUAD_COEFFS *quads; //new ones
|
||||||
|
@ -778,10 +778,10 @@ int IntegerMatcher::UpdateTablesForFeature(
|
|||||||
const INT_FEATURE_STRUCT* Feature,
|
const INT_FEATURE_STRUCT* Feature,
|
||||||
ScratchEvidence *tables,
|
ScratchEvidence *tables,
|
||||||
int Debug) {
|
int Debug) {
|
||||||
register uinT32 ConfigWord;
|
uinT32 ConfigWord;
|
||||||
register uinT32 ProtoWord;
|
uinT32 ProtoWord;
|
||||||
register uinT32 ProtoNum;
|
uinT32 ProtoNum;
|
||||||
register uinT32 ActualProtoNum;
|
uinT32 ActualProtoNum;
|
||||||
uinT8 proto_byte;
|
uinT8 proto_byte;
|
||||||
inT32 proto_word_offset;
|
inT32 proto_word_offset;
|
||||||
inT32 proto_offset;
|
inT32 proto_offset;
|
||||||
@ -795,14 +795,14 @@ int IntegerMatcher::UpdateTablesForFeature(
|
|||||||
uinT32 XFeatureAddress;
|
uinT32 XFeatureAddress;
|
||||||
uinT32 YFeatureAddress;
|
uinT32 YFeatureAddress;
|
||||||
uinT32 ThetaFeatureAddress;
|
uinT32 ThetaFeatureAddress;
|
||||||
register uinT8 *UINT8Pointer;
|
uinT8 *UINT8Pointer;
|
||||||
register int ProtoIndex;
|
int ProtoIndex;
|
||||||
uinT8 Temp;
|
uinT8 Temp;
|
||||||
register int *IntPointer;
|
int *IntPointer;
|
||||||
int ConfigNum;
|
int ConfigNum;
|
||||||
register inT32 M3;
|
inT32 M3;
|
||||||
register inT32 A3;
|
inT32 A3;
|
||||||
register uinT32 A4;
|
uinT32 A4;
|
||||||
|
|
||||||
tables->ClearFeatureEvidence(ClassTemplate);
|
tables->ClearFeatureEvidence(ClassTemplate);
|
||||||
|
|
||||||
@ -1240,7 +1240,7 @@ float IntegerMatcher::ApplyCNCorrection(float rating, int blob_length,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
HeapSort (int n, register int ra[], register int rb[]) {
|
HeapSort (int n, register int ra[], register int rb[]) {
|
||||||
register int i, rra, rrb;
|
int i, rra, rrb;
|
||||||
int l, j, ir;
|
int l, j, ir;
|
||||||
|
|
||||||
l = (n >> 1) + 1;
|
l = (n >> 1) + 1;
|
||||||
|
@ -297,7 +297,7 @@ int AddIntProto(INT_CLASS Class) {
|
|||||||
int ProtoSetId;
|
int ProtoSetId;
|
||||||
PROTO_SET ProtoSet;
|
PROTO_SET ProtoSet;
|
||||||
INT_PROTO Proto;
|
INT_PROTO Proto;
|
||||||
register uinT32 *Word;
|
uinT32 *Word;
|
||||||
|
|
||||||
if (Class->NumProtos >= MAX_NUM_PROTOS)
|
if (Class->NumProtos >= MAX_NUM_PROTOS)
|
||||||
return (NO_PROTO);
|
return (NO_PROTO);
|
||||||
@ -1256,8 +1256,8 @@ void DoFill(FILL_SPEC *FillSpec,
|
|||||||
register uinT32 ClassMask,
|
register uinT32 ClassMask,
|
||||||
register uinT32 ClassCount,
|
register uinT32 ClassCount,
|
||||||
register uinT32 WordIndex) {
|
register uinT32 WordIndex) {
|
||||||
register int X, Y, Angle;
|
int X, Y, Angle;
|
||||||
register uinT32 OldWord;
|
uinT32 OldWord;
|
||||||
|
|
||||||
X = FillSpec->X;
|
X = FillSpec->X;
|
||||||
if (X < 0)
|
if (X < 0)
|
||||||
|
@ -32,7 +32,7 @@ typedef uinT32 *BIT_VECTOR;
|
|||||||
-----------------------------------------------------------------------------*/
|
-----------------------------------------------------------------------------*/
|
||||||
#define zero_all_bits(array,length) \
|
#define zero_all_bits(array,length) \
|
||||||
{\
|
{\
|
||||||
register int index; /*temporary index*/\
|
int index; /*temporary index*/\
|
||||||
\
|
\
|
||||||
for (index=0;index<length;index++)\
|
for (index=0;index<length;index++)\
|
||||||
array[index]=0; /*zero all bits*/\
|
array[index]=0; /*zero all bits*/\
|
||||||
@ -40,7 +40,7 @@ for (index=0;index<length;index++)\
|
|||||||
|
|
||||||
#define set_all_bits(array,length) \
|
#define set_all_bits(array,length) \
|
||||||
{\
|
{\
|
||||||
register int index; /*temporary index*/\
|
int index; /*temporary index*/\
|
||||||
\
|
\
|
||||||
for (index=0;index<length;index++)\
|
for (index=0;index<length;index++)\
|
||||||
array[index]= ~0; /*set all bits*/\
|
array[index]= ~0; /*set all bits*/\
|
||||||
@ -48,7 +48,7 @@ for (index=0;index<length;index++)\
|
|||||||
|
|
||||||
#define copy_all_bits(source,dest,length) \
|
#define copy_all_bits(source,dest,length) \
|
||||||
{\
|
{\
|
||||||
register int index; /*temporary index*/\
|
int index; /*temporary index*/\
|
||||||
\
|
\
|
||||||
for (index=0;index<length;index++)\
|
for (index=0;index<length;index++)\
|
||||||
dest[index]=source[index]; /*copy all bits*/\
|
dest[index]=source[index]; /*copy all bits*/\
|
||||||
|
@ -121,7 +121,7 @@ void Textord::make_old_baselines(TO_BLOCK *block, // block to do
|
|||||||
void Textord::correlate_lines(TO_BLOCK *block, float gradient) {
|
void Textord::correlate_lines(TO_BLOCK *block, float gradient) {
|
||||||
TO_ROW **rows; //array of ptrs
|
TO_ROW **rows; //array of ptrs
|
||||||
int rowcount; /*no of rows to do */
|
int rowcount; /*no of rows to do */
|
||||||
register int rowindex; /*no of row */
|
int rowindex; /*no of row */
|
||||||
//iterator
|
//iterator
|
||||||
TO_ROW_IT row_it = block->get_rows ();
|
TO_ROW_IT row_it = block->get_rows ();
|
||||||
|
|
||||||
@ -164,8 +164,8 @@ void Textord::correlate_neighbours(TO_BLOCK *block, // block rows are in.
|
|||||||
TO_ROW **rows, // rows of block.
|
TO_ROW **rows, // rows of block.
|
||||||
int rowcount) { // no of rows to do.
|
int rowcount) { // no of rows to do.
|
||||||
TO_ROW *row; /*current row */
|
TO_ROW *row; /*current row */
|
||||||
register int rowindex; /*no of row */
|
int rowindex; /*no of row */
|
||||||
register int otherrow; /*second row */
|
int otherrow; /*second row */
|
||||||
int upperrow; /*row above to use */
|
int upperrow; /*row above to use */
|
||||||
int lowerrow; /*row below to use */
|
int lowerrow; /*row below to use */
|
||||||
float biggest;
|
float biggest;
|
||||||
@ -220,7 +220,7 @@ int Textord::correlate_with_stats(TO_ROW **rows, // rows of block.
|
|||||||
int rowcount, // no of rows to do.
|
int rowcount, // no of rows to do.
|
||||||
TO_BLOCK* block) {
|
TO_BLOCK* block) {
|
||||||
TO_ROW *row; /*current row */
|
TO_ROW *row; /*current row */
|
||||||
register int rowindex; /*no of row */
|
int rowindex; /*no of row */
|
||||||
float lineheight; /*mean x-height */
|
float lineheight; /*mean x-height */
|
||||||
float ascheight; /*average ascenders */
|
float ascheight; /*average ascenders */
|
||||||
float minascheight; /*min allowed ascheight */
|
float minascheight; /*min allowed ascheight */
|
||||||
@ -447,7 +447,7 @@ int get_blob_coords( //get boxes
|
|||||||
) {
|
) {
|
||||||
//blobs
|
//blobs
|
||||||
BLOBNBOX_IT blob_it = row->blob_list ();
|
BLOBNBOX_IT blob_it = row->blob_list ();
|
||||||
register int blobindex; /*no along text line */
|
int blobindex; /*no along text line */
|
||||||
int losscount; //lost blobs
|
int losscount; //lost blobs
|
||||||
int maxlosscount; //greatest lost blobs
|
int maxlosscount; //greatest lost blobs
|
||||||
/*height stat collection */
|
/*height stat collection */
|
||||||
@ -719,7 +719,7 @@ QSPLINE * spline, /*curve to fit to */
|
|||||||
float jumplimit, /*allowed delta change */
|
float jumplimit, /*allowed delta change */
|
||||||
float ydiffs[] /*diff from spline */
|
float ydiffs[] /*diff from spline */
|
||||||
) {
|
) {
|
||||||
register int blobindex; /*no along text line */
|
int blobindex; /*no along text line */
|
||||||
int bestpart; /*best new partition */
|
int bestpart; /*best new partition */
|
||||||
int biggestpart; /*part with most members */
|
int biggestpart; /*part with most members */
|
||||||
float diff; /*difference from line */
|
float diff; /*difference from line */
|
||||||
@ -800,7 +800,7 @@ float jumplimit /*allowed delta change */
|
|||||||
) {
|
) {
|
||||||
BOOL8 found_one; //found a bestpart blob
|
BOOL8 found_one; //found a bestpart blob
|
||||||
BOOL8 close_one; //found was close enough
|
BOOL8 close_one; //found was close enough
|
||||||
register int blobindex; /*no along text line */
|
int blobindex; /*no along text line */
|
||||||
int prevpart; //previous iteration
|
int prevpart; //previous iteration
|
||||||
int runlength; //no in this part
|
int runlength; //no in this part
|
||||||
float diff; /*difference from line */
|
float diff; /*difference from line */
|
||||||
@ -909,7 +909,7 @@ int blobcount, /*no of blobs */
|
|||||||
QSPLINE * spline, /*approximating spline */
|
QSPLINE * spline, /*approximating spline */
|
||||||
float ydiffs[] /*output */
|
float ydiffs[] /*output */
|
||||||
) {
|
) {
|
||||||
register int blobindex; /*current blob */
|
int blobindex; /*current blob */
|
||||||
int xcentre; /*xcoord */
|
int xcentre; /*xcoord */
|
||||||
int lastx; /*last xcentre */
|
int lastx; /*last xcentre */
|
||||||
float diffsum; /*sum of diffs */
|
float diffsum; /*sum of diffs */
|
||||||
@ -963,7 +963,7 @@ float* drift,
|
|||||||
float* lastdelta,
|
float* lastdelta,
|
||||||
int *partcount /*no of partitions */
|
int *partcount /*no of partitions */
|
||||||
) {
|
) {
|
||||||
register int partition; /*partition no */
|
int partition; /*partition no */
|
||||||
int bestpart; /*best new partition */
|
int bestpart; /*best new partition */
|
||||||
float bestdelta; /*best gap from a part */
|
float bestdelta; /*best gap from a part */
|
||||||
float delta; /*diff from part */
|
float delta; /*diff from part */
|
||||||
@ -1028,7 +1028,7 @@ int *partcount /*no of partitions */
|
|||||||
//int blobcount; /*no of blobs*/
|
//int blobcount; /*no of blobs*/
|
||||||
//int bestpart; /*best partition*/
|
//int bestpart; /*best partition*/
|
||||||
//{
|
//{
|
||||||
// register int blobindex; /*no along text line*/
|
// int blobindex; /*no along text line*/
|
||||||
// int runlength; /*run of same partition*/
|
// int runlength; /*run of same partition*/
|
||||||
// int bestrun; /*biggest runlength*/
|
// int bestrun; /*biggest runlength*/
|
||||||
//
|
//
|
||||||
@ -1089,7 +1089,7 @@ int bestpart, /*best new partition */
|
|||||||
int xcoords[], /*points to work on */
|
int xcoords[], /*points to work on */
|
||||||
int ycoords[] /*points to work on */
|
int ycoords[] /*points to work on */
|
||||||
) {
|
) {
|
||||||
register int blobindex; /*no along text line */
|
int blobindex; /*no along text line */
|
||||||
int pointcount; /*no of points */
|
int pointcount; /*no of points */
|
||||||
|
|
||||||
pointcount = 0;
|
pointcount = 0;
|
||||||
@ -1120,8 +1120,8 @@ int ycoords[], /*points to work on */
|
|||||||
int degree, int pointcount, /*no of points */
|
int degree, int pointcount, /*no of points */
|
||||||
int xstarts[] //result
|
int xstarts[] //result
|
||||||
) {
|
) {
|
||||||
register int ptindex; /*no along text line */
|
int ptindex; /*no along text line */
|
||||||
register int segment; /*partition no */
|
int segment; /*partition no */
|
||||||
int lastmin, lastmax; /*possible turn points */
|
int lastmin, lastmax; /*possible turn points */
|
||||||
int turnpoints[SPLINESIZE]; /*good turning points */
|
int turnpoints[SPLINESIZE]; /*good turning points */
|
||||||
int turncount; /*no of turning points */
|
int turncount; /*no of turning points */
|
||||||
@ -1245,7 +1245,7 @@ int xstarts[], //result
|
|||||||
int &segments //no of segments
|
int &segments //no of segments
|
||||||
) {
|
) {
|
||||||
BOOL8 doneany; //return value
|
BOOL8 doneany; //return value
|
||||||
register int segment; /*partition no */
|
int segment; /*partition no */
|
||||||
int startindex, centreindex, endindex;
|
int startindex, centreindex, endindex;
|
||||||
float leftcoord, rightcoord;
|
float leftcoord, rightcoord;
|
||||||
int leftindex, rightindex;
|
int leftindex, rightindex;
|
||||||
@ -1377,8 +1377,8 @@ int partsizes[], /*size of each part */
|
|||||||
int partcount, /*no of partitions */
|
int partcount, /*no of partitions */
|
||||||
int bestpart /*biggest partition */
|
int bestpart /*biggest partition */
|
||||||
) {
|
) {
|
||||||
register int blobindex; /*index of blob */
|
int blobindex; /*index of blob */
|
||||||
register int partition; /*current partition */
|
int partition; /*current partition */
|
||||||
int xcentre; /*centre of blob */
|
int xcentre; /*centre of blob */
|
||||||
int poscount; /*count of best up step */
|
int poscount; /*count of best up step */
|
||||||
int negcount; /*count of best down step */
|
int negcount; /*count of best down step */
|
||||||
@ -1459,7 +1459,7 @@ int blobcount, /*blobs in blobcoords */
|
|||||||
QSPLINE * baseline, /*established */
|
QSPLINE * baseline, /*established */
|
||||||
float jumplimit /*min ascender height */
|
float jumplimit /*min ascender height */
|
||||||
) {
|
) {
|
||||||
register int blobindex; /*current blob */
|
int blobindex; /*current blob */
|
||||||
/*height statistics */
|
/*height statistics */
|
||||||
STATS heightstat (0, MAXHEIGHT);
|
STATS heightstat (0, MAXHEIGHT);
|
||||||
int height; /*height of blob */
|
int height; /*height of blob */
|
||||||
@ -1469,7 +1469,7 @@ float jumplimit /*min ascender height */
|
|||||||
int asccount; /*no of ascenders */
|
int asccount; /*no of ascenders */
|
||||||
float xsum; /*xheight sum */
|
float xsum; /*xheight sum */
|
||||||
int xcount; /*xheight count */
|
int xcount; /*xheight count */
|
||||||
register float diff; /*height difference */
|
float diff; /*height difference */
|
||||||
|
|
||||||
if (blobcount > 1) {
|
if (blobcount > 1) {
|
||||||
for (blobindex = 0; blobindex < blobcount; blobindex++) {
|
for (blobindex = 0; blobindex < blobcount; blobindex++) {
|
||||||
|
@ -49,8 +49,8 @@ namespace tesseract {
|
|||||||
* 100 = "no way jay"
|
* 100 = "no way jay"
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
PRIORITY Wordrec::grade_split_length(register SPLIT *split) {
|
PRIORITY Wordrec::grade_split_length(register SPLIT *split) {
|
||||||
register PRIORITY grade;
|
PRIORITY grade;
|
||||||
register float split_length;
|
float split_length;
|
||||||
|
|
||||||
split_length =
|
split_length =
|
||||||
split->point1->WeightedDistance(*split->point2, chop_x_y_weight);
|
split->point1->WeightedDistance(*split->point2, chop_x_y_weight);
|
||||||
@ -72,7 +72,7 @@ PRIORITY Wordrec::grade_split_length(register SPLIT *split) {
|
|||||||
* 100 = "no way jay"
|
* 100 = "no way jay"
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
PRIORITY Wordrec::grade_sharpness(register SPLIT *split) {
|
PRIORITY Wordrec::grade_sharpness(register SPLIT *split) {
|
||||||
register PRIORITY grade;
|
PRIORITY grade;
|
||||||
|
|
||||||
grade = point_priority (split->point1) + point_priority (split->point2);
|
grade = point_priority (split->point1) + point_priority (split->point2);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user