Skip to content

Commit 83541d8

Browse files
committed
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 <[email protected]>
1 parent 479fe9c commit 83541d8

File tree

7 files changed

+54
-54
lines changed

7 files changed

+54
-54
lines changed

ccstruct/polyaprx.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -214,18 +214,18 @@ EDGEPT edgepts[] //output is array
214214
void fix2( //polygonal approx
215215
EDGEPT *start, /*loop to approimate */
216216
int area) {
217-
register EDGEPT *edgept; /*current point */
218-
register EDGEPT *edgept1;
219-
register EDGEPT *loopstart; /*modified start of loop */
220-
register EDGEPT *linestart; /*start of line segment */
221-
register int dir1, dir2; /*directions of line */
222-
register int sum1, sum2; /*lengths in dir1,dir2 */
217+
EDGEPT *edgept; /*current point */
218+
EDGEPT *edgept1;
219+
EDGEPT *loopstart; /*modified start of loop */
220+
EDGEPT *linestart; /*start of line segment */
221+
int dir1, dir2; /*directions of line */
222+
int sum1, sum2; /*lengths in dir1,dir2 */
223223
int stopped; /*completed flag */
224224
int fixed_count; //no of fixed points
225225
int d01, d12, d23, gapmin;
226226
TPOINT d01vec, d12vec, d23vec;
227-
register EDGEPT *edgefix, *startfix;
228-
register EDGEPT *edgefix0, *edgefix1, *edgefix2, *edgefix3;
227+
EDGEPT *edgefix, *startfix;
228+
EDGEPT *edgefix0, *edgefix1, *edgefix2, *edgefix3;
229229

230230
edgept = start; /*start of loop */
231231
while (((edgept->flags[DIR] - edgept->prev->flags[DIR] + 1) & 7) < 3
@@ -400,10 +400,10 @@ EDGEPT *poly2( //second poly
400400
EDGEPT *startpt, /*start of loop */
401401
int area /*area of blob box */
402402
) {
403-
register EDGEPT *edgept; /*current outline point */
403+
EDGEPT *edgept; /*current outline point */
404404
EDGEPT *loopstart; /*starting point */
405-
register EDGEPT *linestart; /*start of line */
406-
register int edgesum; /*correction count */
405+
EDGEPT *linestart; /*start of line */
406+
int edgesum; /*correction count */
407407

408408
if (area < 1200)
409409
area = 1200; /*minimum value */
@@ -499,13 +499,13 @@ void cutline( //recursive refine
499499
EDGEPT *last,
500500
int area /*area of object */
501501
) {
502-
register EDGEPT *edge; /*current edge */
502+
EDGEPT *edge; /*current edge */
503503
TPOINT vecsum; /*vector sum */
504504
int vlen; /*approx length of vecsum */
505505
TPOINT vec; /*accumulated vector */
506506
EDGEPT *maxpoint; /*worst point */
507507
int maxperp; /*max deviation */
508-
register int perp; /*perp distance */
508+
int perp; /*perp distance */
509509
int ptcount; /*no of points */
510510
int squaresum; /*sum of perps */
511511

ccstruct/quspline.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ int xpts[], //points to fit
7171
int ypts[], int pointcount, //no of pts
7272
int degree //fit required
7373
) {
74-
register int pointindex; /*no along text line */
75-
register int segment; /*segment no */
74+
int pointindex; /*no along text line */
75+
int segment; /*segment no */
7676
inT32 *ptcounts; //no in each segment
7777
QLSQ qlsq; /*accumulator */
7878

@@ -308,7 +308,7 @@ void QSPLINE::extrapolate( //linear extrapolation
308308
int xmin, //new left edge
309309
int xmax //new right edge
310310
) {
311-
register int segment; /*current segment of spline */
311+
int segment; /*current segment of spline */
312312
int dest_segment; //dest index
313313
int *xstarts; //new boundaries
314314
QUAD_COEFFS *quads; //new ones

classify/intmatcher.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,10 @@ int IntegerMatcher::UpdateTablesForFeature(
778778
const INT_FEATURE_STRUCT* Feature,
779779
ScratchEvidence *tables,
780780
int Debug) {
781-
register uinT32 ConfigWord;
782-
register uinT32 ProtoWord;
783-
register uinT32 ProtoNum;
784-
register uinT32 ActualProtoNum;
781+
uinT32 ConfigWord;
782+
uinT32 ProtoWord;
783+
uinT32 ProtoNum;
784+
uinT32 ActualProtoNum;
785785
uinT8 proto_byte;
786786
inT32 proto_word_offset;
787787
inT32 proto_offset;
@@ -795,14 +795,14 @@ int IntegerMatcher::UpdateTablesForFeature(
795795
uinT32 XFeatureAddress;
796796
uinT32 YFeatureAddress;
797797
uinT32 ThetaFeatureAddress;
798-
register uinT8 *UINT8Pointer;
799-
register int ProtoIndex;
798+
uinT8 *UINT8Pointer;
799+
int ProtoIndex;
800800
uinT8 Temp;
801-
register int *IntPointer;
801+
int *IntPointer;
802802
int ConfigNum;
803-
register inT32 M3;
804-
register inT32 A3;
805-
register uinT32 A4;
803+
inT32 M3;
804+
inT32 A3;
805+
uinT32 A4;
806806

807807
tables->ClearFeatureEvidence(ClassTemplate);
808808

@@ -1240,7 +1240,7 @@ float IntegerMatcher::ApplyCNCorrection(float rating, int blob_length,
12401240
*/
12411241
void
12421242
HeapSort (int n, register int ra[], register int rb[]) {
1243-
register int i, rra, rrb;
1243+
int i, rra, rrb;
12441244
int l, j, ir;
12451245

12461246
l = (n >> 1) + 1;

classify/intproto.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ int AddIntProto(INT_CLASS Class) {
297297
int ProtoSetId;
298298
PROTO_SET ProtoSet;
299299
INT_PROTO Proto;
300-
register uinT32 *Word;
300+
uinT32 *Word;
301301

302302
if (Class->NumProtos >= MAX_NUM_PROTOS)
303303
return (NO_PROTO);
@@ -1256,8 +1256,8 @@ void DoFill(FILL_SPEC *FillSpec,
12561256
register uinT32 ClassMask,
12571257
register uinT32 ClassCount,
12581258
register uinT32 WordIndex) {
1259-
register int X, Y, Angle;
1260-
register uinT32 OldWord;
1259+
int X, Y, Angle;
1260+
uinT32 OldWord;
12611261

12621262
X = FillSpec->X;
12631263
if (X < 0)

cutil/bitvec.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ typedef uinT32 *BIT_VECTOR;
3232
-----------------------------------------------------------------------------*/
3333
#define zero_all_bits(array,length) \
3434
{\
35-
register int index; /*temporary index*/\
35+
int index; /*temporary index*/\
3636
\
3737
for (index=0;index<length;index++)\
3838
array[index]=0; /*zero all bits*/\
3939
}
4040

4141
#define set_all_bits(array,length) \
4242
{\
43-
register int index; /*temporary index*/\
43+
int index; /*temporary index*/\
4444
\
4545
for (index=0;index<length;index++)\
4646
array[index]= ~0; /*set all bits*/\
4747
}
4848

4949
#define copy_all_bits(source,dest,length) \
5050
{\
51-
register int index; /*temporary index*/\
51+
int index; /*temporary index*/\
5252
\
5353
for (index=0;index<length;index++)\
5454
dest[index]=source[index]; /*copy all bits*/\

textord/oldbasel.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void Textord::make_old_baselines(TO_BLOCK *block, // block to do
121121
void Textord::correlate_lines(TO_BLOCK *block, float gradient) {
122122
TO_ROW **rows; //array of ptrs
123123
int rowcount; /*no of rows to do */
124-
register int rowindex; /*no of row */
124+
int rowindex; /*no of row */
125125
//iterator
126126
TO_ROW_IT row_it = block->get_rows ();
127127

@@ -164,8 +164,8 @@ void Textord::correlate_neighbours(TO_BLOCK *block, // block rows are in.
164164
TO_ROW **rows, // rows of block.
165165
int rowcount) { // no of rows to do.
166166
TO_ROW *row; /*current row */
167-
register int rowindex; /*no of row */
168-
register int otherrow; /*second row */
167+
int rowindex; /*no of row */
168+
int otherrow; /*second row */
169169
int upperrow; /*row above to use */
170170
int lowerrow; /*row below to use */
171171
float biggest;
@@ -220,7 +220,7 @@ int Textord::correlate_with_stats(TO_ROW **rows, // rows of block.
220220
int rowcount, // no of rows to do.
221221
TO_BLOCK* block) {
222222
TO_ROW *row; /*current row */
223-
register int rowindex; /*no of row */
223+
int rowindex; /*no of row */
224224
float lineheight; /*mean x-height */
225225
float ascheight; /*average ascenders */
226226
float minascheight; /*min allowed ascheight */
@@ -447,7 +447,7 @@ int get_blob_coords( //get boxes
447447
) {
448448
//blobs
449449
BLOBNBOX_IT blob_it = row->blob_list ();
450-
register int blobindex; /*no along text line */
450+
int blobindex; /*no along text line */
451451
int losscount; //lost blobs
452452
int maxlosscount; //greatest lost blobs
453453
/*height stat collection */
@@ -719,7 +719,7 @@ QSPLINE * spline, /*curve to fit to */
719719
float jumplimit, /*allowed delta change */
720720
float ydiffs[] /*diff from spline */
721721
) {
722-
register int blobindex; /*no along text line */
722+
int blobindex; /*no along text line */
723723
int bestpart; /*best new partition */
724724
int biggestpart; /*part with most members */
725725
float diff; /*difference from line */
@@ -800,7 +800,7 @@ float jumplimit /*allowed delta change */
800800
) {
801801
BOOL8 found_one; //found a bestpart blob
802802
BOOL8 close_one; //found was close enough
803-
register int blobindex; /*no along text line */
803+
int blobindex; /*no along text line */
804804
int prevpart; //previous iteration
805805
int runlength; //no in this part
806806
float diff; /*difference from line */
@@ -909,7 +909,7 @@ int blobcount, /*no of blobs */
909909
QSPLINE * spline, /*approximating spline */
910910
float ydiffs[] /*output */
911911
) {
912-
register int blobindex; /*current blob */
912+
int blobindex; /*current blob */
913913
int xcentre; /*xcoord */
914914
int lastx; /*last xcentre */
915915
float diffsum; /*sum of diffs */
@@ -963,7 +963,7 @@ float* drift,
963963
float* lastdelta,
964964
int *partcount /*no of partitions */
965965
) {
966-
register int partition; /*partition no */
966+
int partition; /*partition no */
967967
int bestpart; /*best new partition */
968968
float bestdelta; /*best gap from a part */
969969
float delta; /*diff from part */
@@ -1028,7 +1028,7 @@ int *partcount /*no of partitions */
10281028
//int blobcount; /*no of blobs*/
10291029
//int bestpart; /*best partition*/
10301030
//{
1031-
// register int blobindex; /*no along text line*/
1031+
// int blobindex; /*no along text line*/
10321032
// int runlength; /*run of same partition*/
10331033
// int bestrun; /*biggest runlength*/
10341034
//
@@ -1089,7 +1089,7 @@ int bestpart, /*best new partition */
10891089
int xcoords[], /*points to work on */
10901090
int ycoords[] /*points to work on */
10911091
) {
1092-
register int blobindex; /*no along text line */
1092+
int blobindex; /*no along text line */
10931093
int pointcount; /*no of points */
10941094

10951095
pointcount = 0;
@@ -1120,8 +1120,8 @@ int ycoords[], /*points to work on */
11201120
int degree, int pointcount, /*no of points */
11211121
int xstarts[] //result
11221122
) {
1123-
register int ptindex; /*no along text line */
1124-
register int segment; /*partition no */
1123+
int ptindex; /*no along text line */
1124+
int segment; /*partition no */
11251125
int lastmin, lastmax; /*possible turn points */
11261126
int turnpoints[SPLINESIZE]; /*good turning points */
11271127
int turncount; /*no of turning points */
@@ -1245,7 +1245,7 @@ int xstarts[], //result
12451245
int &segments //no of segments
12461246
) {
12471247
BOOL8 doneany; //return value
1248-
register int segment; /*partition no */
1248+
int segment; /*partition no */
12491249
int startindex, centreindex, endindex;
12501250
float leftcoord, rightcoord;
12511251
int leftindex, rightindex;
@@ -1377,8 +1377,8 @@ int partsizes[], /*size of each part */
13771377
int partcount, /*no of partitions */
13781378
int bestpart /*biggest partition */
13791379
) {
1380-
register int blobindex; /*index of blob */
1381-
register int partition; /*current partition */
1380+
int blobindex; /*index of blob */
1381+
int partition; /*current partition */
13821382
int xcentre; /*centre of blob */
13831383
int poscount; /*count of best up step */
13841384
int negcount; /*count of best down step */
@@ -1459,7 +1459,7 @@ int blobcount, /*blobs in blobcoords */
14591459
QSPLINE * baseline, /*established */
14601460
float jumplimit /*min ascender height */
14611461
) {
1462-
register int blobindex; /*current blob */
1462+
int blobindex; /*current blob */
14631463
/*height statistics */
14641464
STATS heightstat (0, MAXHEIGHT);
14651465
int height; /*height of blob */
@@ -1469,7 +1469,7 @@ float jumplimit /*min ascender height */
14691469
int asccount; /*no of ascenders */
14701470
float xsum; /*xheight sum */
14711471
int xcount; /*xheight count */
1472-
register float diff; /*height difference */
1472+
float diff; /*height difference */
14731473

14741474
if (blobcount > 1) {
14751475
for (blobindex = 0; blobindex < blobcount; blobindex++) {

wordrec/gradechop.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ namespace tesseract {
4949
* 100 = "no way jay"
5050
**********************************************************************/
5151
PRIORITY Wordrec::grade_split_length(register SPLIT *split) {
52-
register PRIORITY grade;
53-
register float split_length;
52+
PRIORITY grade;
53+
float split_length;
5454

5555
split_length =
5656
split->point1->WeightedDistance(*split->point2, chop_x_y_weight);
@@ -72,7 +72,7 @@ PRIORITY Wordrec::grade_split_length(register SPLIT *split) {
7272
* 100 = "no way jay"
7373
**********************************************************************/
7474
PRIORITY Wordrec::grade_sharpness(register SPLIT *split) {
75-
register PRIORITY grade;
75+
PRIORITY grade;
7676

7777
grade = point_priority (split->point1) + point_priority (split->point2);
7878

0 commit comments

Comments
 (0)