Skip to content

Commit 539b7fb

Browse files
committed
ccutil: Fix typos in comments and strings
Most of them were found by codespell. Signed-off-by: Stefan Weil <[email protected]>
1 parent bef8cad commit 539b7fb

13 files changed

+45
-45
lines changed

ccutil/clst.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ const void *, const void *)) {
190190

191191
// Assuming list has been sorted already, insert new_data to
192192
// keep the list sorted according to the same comparison function.
193-
// Comparision function is the same as used by sort, i.e. uses double
193+
// Comparison function is the same as used by sort, i.e. uses double
194194
// indirection. Time is O(1) to add to beginning or end.
195195
// Time is linear to add pre-sorted items to an empty list.
196196
// If unique, then don't add duplicate entries.
@@ -513,7 +513,7 @@ CLIST_LINK *CLIST_ITERATOR::extract_sublist( //from
513513

514514
temp_it.mark_cycle_pt ();
515515
do { //walk sublist
516-
if (temp_it.cycled_list ()) //cant find end pt
516+
if (temp_it.cycled_list ()) //can't find end pt
517517
BAD_SUBLIST.error ("CLIST_ITERATOR.extract_sublist", ABORT, NULL);
518518

519519
if (temp_it.at_last ()) {

ccutil/clst.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ class DLLSYM CLIST_LINK
5151
}
5252

5353
CLIST_LINK( //copy constructor
54-
const CLIST_LINK &) { //dont copy link
54+
const CLIST_LINK &) { //don't copy link
5555
data = next = NULL;
5656
}
5757

58-
void operator= ( //dont copy links
58+
void operator= ( //don't copy links
5959
const CLIST_LINK &) {
6060
data = next = NULL;
6161
}
@@ -89,7 +89,7 @@ class DLLSYM CLIST
8989
void internal_deep_clear ( //destroy all links
9090
void (*zapper) (void *)); //ptr to zapper functn
9191

92-
void shallow_clear(); //clear list but dont
92+
void shallow_clear(); //clear list but don't
9393
//delete data elements
9494

9595
bool empty() const { //is list empty?
@@ -117,7 +117,7 @@ class DLLSYM CLIST
117117

118118
// Assuming list has been sorted already, insert new_data to
119119
// keep the list sorted according to the same comparison function.
120-
// Comparision function is the same as used by sort, i.e. uses double
120+
// Comparison function is the same as used by sort, i.e. uses double
121121
// indirection. Time is O(1) to add to beginning or end.
122122
// Time is linear to add pre-sorted items to an empty list.
123123
// If unique, then don't add duplicate entries.
@@ -232,7 +232,7 @@ class DLLSYM CLIST_ITERATOR
232232
BOOL8 cycled_list(); //Completed a cycle?
233233

234234
void add_to_end( //add at end &
235-
void *new_data); //dont move
235+
void *new_data); //don't move
236236

237237
void exchange( //positions of 2 links
238238
CLIST_ITERATOR *other_it); //other iterator
@@ -437,7 +437,7 @@ inline void CLIST_ITERATOR::add_before_then_move( // element to add
437437
/***********************************************************************
438438
* CLIST_ITERATOR::add_before_stay_put
439439
*
440-
* Add a new element to the list before the current element but dont move the
440+
* Add a new element to the list before the current element but don't move the
441441
* iterator to the new element.
442442
**********************************************************************/
443443

@@ -485,7 +485,7 @@ inline void CLIST_ITERATOR::add_before_stay_put( // element to add
485485
/***********************************************************************
486486
* CLIST_ITERATOR::add_list_after
487487
*
488-
* Insert another list to this list after the current element but dont move the
488+
* Insert another list to this list after the current element but don't move the
489489
* iterator.
490490
**********************************************************************/
491491

@@ -836,7 +836,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
836836
837837
CLASSNAME is assumed to be the name of a class to be used in a CONS list
838838
839-
NOTE: Because we dont use virtual functions in the list code, the list code
839+
NOTE: Because we don't use virtual functions in the list code, the list code
840840
will NOT work correctly for classes derived from this.
841841
842842
The macro generates:
@@ -885,7 +885,7 @@ public: \
885885
CLASSNAME##_CLIST():CLIST() {} \
886886
/* constructor */ \
887887
\
888-
CLASSNAME##_CLIST( /* dont construct */ \
888+
CLASSNAME##_CLIST( /* don't construct */ \
889889
const CLASSNAME##_CLIST&) /*by initial assign*/ \
890890
{ DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_CLIST ), \
891891
ABORT, NULL ); } \
@@ -963,7 +963,7 @@ CLISTIZEH_C( CLASSNAME )
963963
* A function which can delete a CLASSNAME element. This is passed to the \
964964
* generic deep_clear list member function so that when a list is cleared the \
965965
* elements on the list are properly destroyed from the base class, even \
966-
* though we dont use a virtual destructor function. \
966+
* though we don't use a virtual destructor function. \
967967
**********************************************************************/ \
968968
\
969969
DLLSYM void CLASSNAME##_c1_zapper( /*delete a link*/ \

ccutil/elst.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ inT32 ELIST::length() const { // count elements
117117
* ELIST::sort
118118
*
119119
* Sort elements on list
120-
* NB If you dont like the const declarations in the comparator, coerce yours:
120+
* NB If you don't like the const declarations in the comparator, coerce yours:
121121
* ( int (*)(const void *, const void *)
122122
**********************************************************************/
123123

@@ -161,7 +161,7 @@ const void *, const void *)) {
161161

162162
// Assuming list has been sorted already, insert new_link to
163163
// keep the list sorted according to the same comparison function.
164-
// Comparision function is the same as used by sort, i.e. uses double
164+
// Comparison function is the same as used by sort, i.e. uses double
165165
// indirection. Time is O(1) to add to beginning or end.
166166
// Time is linear to add pre-sorted items to an empty list.
167167
// If unique is set to true and comparator() returns 0 (an entry with the
@@ -455,7 +455,7 @@ ELIST_LINK *ELIST_ITERATOR::extract_sublist( //from
455455

456456
temp_it.mark_cycle_pt ();
457457
do { //walk sublist
458-
if (temp_it.cycled_list ()) //cant find end pt
458+
if (temp_it.cycled_list ()) //can't find end pt
459459
BAD_SUBLIST.error ("ELIST_ITERATOR.extract_sublist", ABORT, NULL);
460460

461461
if (temp_it.at_last ()) {

ccutil/elst.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The implementation of lists is very careful about space and speed overheads.
6767
This is why many embedded lists are provided. The same concerns mean that
6868
in-line type coercion is done, rather than use virtual functions. This is
6969
cumbersome in that each data type to be listed requires its own iterator and
70-
list class - though macros can gererate these. It also prevents heterogenous
70+
list class - though macros can gererate these. It also prevents heterogeneous
7171
lists.
7272
**********************************************************************/
7373

@@ -98,7 +98,7 @@ class DLLSYM ELIST_LINK
9898
next = NULL;
9999
}
100100

101-
void operator= ( //dont copy links
101+
void operator= ( //don't copy links
102102
const ELIST_LINK &) {
103103
next = NULL;
104104
}
@@ -158,7 +158,7 @@ class DLLSYM ELIST
158158

159159
// Assuming list has been sorted already, insert new_link to
160160
// keep the list sorted according to the same comparison function.
161-
// Comparision function is the same as used by sort, i.e. uses double
161+
// Comparison function is the same as used by sort, i.e. uses double
162162
// indirection. Time is O(1) to add to beginning or end.
163163
// Time is linear to add pre-sorted items to an empty list.
164164
// If unique is set to true and comparator() returns 0 (an entry with the
@@ -274,7 +274,7 @@ class DLLSYM ELIST_ITERATOR
274274
bool cycled_list(); //Completed a cycle?
275275

276276
void add_to_end( //add at end &
277-
ELIST_LINK *new_link); //dont move
277+
ELIST_LINK *new_link); //don't move
278278

279279
void exchange( //positions of 2 links
280280
ELIST_ITERATOR *other_it); //other iterator
@@ -470,7 +470,7 @@ inline void ELIST_ITERATOR::add_before_then_move( // element to add
470470
/***********************************************************************
471471
* ELIST_ITERATOR::add_before_stay_put
472472
*
473-
* Add a new element to the list before the current element but dont move the
473+
* Add a new element to the list before the current element but don't move the
474474
* iterator to the new element.
475475
**********************************************************************/
476476

@@ -515,7 +515,7 @@ inline void ELIST_ITERATOR::add_before_stay_put( // element to add
515515
/***********************************************************************
516516
* ELIST_ITERATOR::add_list_after
517517
*
518-
* Insert another list to this list after the current element but dont move the
518+
* Insert another list to this list after the current element but don't move the
519519
* iterator.
520520
**********************************************************************/
521521

@@ -868,7 +868,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
868868
CLASSNAME is assumed to be the name of a class which has a baseclass of
869869
ELIST_LINK.
870870
871-
NOTE: Because we dont use virtual functions in the list code, the list code
871+
NOTE: Because we don't use virtual functions in the list code, the list code
872872
will NOT work correctly for classes derived from this.
873873
874874
The macros generate:
@@ -999,7 +999,7 @@ ELISTIZEH_C( CLASSNAME )
999999
* A function which can delete a CLASSNAME element. This is passed to the \
10001000
* generic clear list member function so that when a list is cleared the \
10011001
* elements on the list are properly destroyed from the base class, even \
1002-
* though we dont use a virtual destructor function. \
1002+
* though we don't use a virtual destructor function. \
10031003
**********************************************************************/ \
10041004
\
10051005
DLLSYM void CLASSNAME##_zapper(ELIST_LINK* link) { \

ccutil/elst2.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ inT32 ELIST2::length() const { // count elements
118118
* ELIST2::sort
119119
*
120120
* Sort elements on list
121-
* NB If you dont like the const declarations in the comparator, coerce yours:
121+
* NB If you don't like the const declarations in the comparator, coerce yours:
122122
* ( int (*)(const void *, const void *)
123123
**********************************************************************/
124124

@@ -162,7 +162,7 @@ const void *, const void *)) {
162162

163163
// Assuming list has been sorted already, insert new_link to
164164
// keep the list sorted according to the same comparison function.
165-
// Comparision function is the same as used by sort, i.e. uses double
165+
// Comparison function is the same as used by sort, i.e. uses double
166166
// indirection. Time is O(1) to add to beginning or end.
167167
// Time is linear to add pre-sorted items to an empty list.
168168
void ELIST2::add_sorted(int comparator(const void*, const void*),
@@ -475,7 +475,7 @@ ELIST2_LINK *ELIST2_ITERATOR::extract_sublist( //fr
475475

476476
temp_it.mark_cycle_pt ();
477477
do { //walk sublist
478-
if (temp_it.cycled_list ()) //cant find end pt
478+
if (temp_it.cycled_list ()) //can't find end pt
479479
BAD_SUBLIST.error ("ELIST2_ITERATOR.extract_sublist", ABORT, NULL);
480480

481481
if (temp_it.at_last ()) {

ccutil/elst2.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ class DLLSYM ELIST2_LINK
6969
}
7070

7171
ELIST2_LINK( //copy constructor
72-
const ELIST2_LINK &) { //dont copy link
72+
const ELIST2_LINK &) { //don't copy link
7373
prev = next = NULL;
7474
}
7575

76-
void operator= ( //dont copy links
76+
void operator= ( //don't copy links
7777
const ELIST2_LINK &) {
7878
prev = next = NULL;
7979
}
@@ -133,7 +133,7 @@ class DLLSYM ELIST2
133133

134134
// Assuming list has been sorted already, insert new_link to
135135
// keep the list sorted according to the same comparison function.
136-
// Comparision function is the same as used by sort, i.e. uses double
136+
// Comparison function is the same as used by sort, i.e. uses double
137137
// indirection. Time is O(1) to add to beginning or end.
138138
// Time is linear to add pre-sorted items to an empty list.
139139
void add_sorted(int comparator(const void*, const void*),
@@ -241,7 +241,7 @@ class DLLSYM ELIST2_ITERATOR
241241
BOOL8 cycled_list(); //Completed a cycle?
242242

243243
void add_to_end( //add at end &
244-
ELIST2_LINK *new_link); //dont move
244+
ELIST2_LINK *new_link); //don't move
245245

246246
void exchange( //positions of 2 links
247247
ELIST2_ITERATOR *other_it); //other iterator
@@ -450,7 +450,7 @@ inline void ELIST2_ITERATOR::add_before_then_move( // element to add
450450
/***********************************************************************
451451
* ELIST2_ITERATOR::add_before_stay_put
452452
*
453-
* Add a new element to the list before the current element but dont move the
453+
* Add a new element to the list before the current element but don't move the
454454
* iterator to the new element.
455455
**********************************************************************/
456456

@@ -500,7 +500,7 @@ inline void ELIST2_ITERATOR::add_before_stay_put( // element to add
500500
/***********************************************************************
501501
* ELIST2_ITERATOR::add_list_after
502502
*
503-
* Insert another list to this list after the current element but dont move the
503+
* Insert another list to this list after the current element but don't move the
504504
* iterator.
505505
**********************************************************************/
506506

@@ -883,7 +883,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
883883
CLASSNAME is assumed to be the name of a class which has a baseclass of
884884
ELIST2_LINK.
885885
886-
NOTE: Because we dont use virtual functions in the list code, the list code
886+
NOTE: Because we don't use virtual functions in the list code, the list code
887887
will NOT work correctly for classes derived from this.
888888
889889
The macro generates:
@@ -927,7 +927,7 @@ public: \
927927
CLASSNAME##_LIST():ELIST2() {} \
928928
/* constructor */ \
929929
\
930-
CLASSNAME##_LIST( /* dont construct */ \
930+
CLASSNAME##_LIST( /* don't construct */ \
931931
const CLASSNAME##_LIST&) /*by initial assign*/\
932932
{ DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_LIST ), \
933933
ABORT, NULL ); } \
@@ -1015,7 +1015,7 @@ ELIST2IZEH_C( CLASSNAME )
10151015
* A function which can delete a CLASSNAME element. This is passed to the \
10161016
* generic clear list member function so that when a list is cleared the \
10171017
* elements on the list are properly destroyed from the base class, even \
1018-
* though we dont use a virtual destructor function. \
1018+
* though we don't use a virtual destructor function. \
10191019
**********************************************************************/ \
10201020
\
10211021
DLLSYM void CLASSNAME##_zapper( /*delete a link*/ \

ccutil/errcode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ enum TessErrorLogCode {
5353
#define LOC_DOC_BLK_REJ 22
5454
#define LOC_WRITE_RESULTS 23
5555
#define LOC_ADAPTIVE 24
56-
/* DONT DEFINE ANY LOCATION > 31 !!! */
56+
/* DON'T DEFINE ANY LOCATION > 31 !!! */
5757

5858
/* Sub locatation determines whether pass2 was in normal mode or fix xht mode*/
5959
#define SUBLOC_NORM 0

ccutil/genericvector.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ bool GenericVector<T>::SerializeClasses(tesseract::TFile* fp) const {
949949

950950
// Reads a vector of classes from the given file. Assumes the existence of
951951
// bool T::Deserialize(bool swap, FILE* fp) that returns false in case of
952-
// error. Alse needs T::T() and T::T(constT&), as init_to_size is used in
952+
// error. Also needs T::T() and T::T(constT&), as init_to_size is used in
953953
// this function. Returns false in case of error.
954954
// If swap is true, assumes a big/little-endian swap is needed.
955955
template <typename T>

ccutil/lsterr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ const ERRCODE NULL_PREV = "Previous element on the list is NULL";
3838
const ERRCODE EMPTY_LIST = "List is empty";
3939
const ERRCODE BAD_PARAMETER = "List parameter error";
4040
const ERRCODE STILL_LINKED =
41-
"Attemting to add an element with non NULL links, to a list";
41+
"Attempting to add an element with non NULL links, to a list";
4242
#endif
4343
#endif

ccutil/ocrclass.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* the HP OCR interface.
2222
* The code is designed to be used with either a C or C++ compiler.
2323
* The structures are designed to allow them to be used with any
24-
* structure alignment upto 8.
24+
* structure alignment up to 8.
2525
**********************************************************************/
2626

2727
#ifndef CCUTIL_OCRCLASS_H_

ccutil/strngs.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const int kMaxDoubleSize = 15;
4545
*
4646
* The collection of MACROS provide different implementations depending
4747
* on whether the string keeps track of its strlen or not so that this
48-
* feature can be added in later when consumers dont modifify the string
48+
* feature can be added in later when consumers don't modify the string
4949
**********************************************************************/
5050

5151
// Smallest string to allocate by default
@@ -339,7 +339,7 @@ STRING& STRING::operator=(const STRING& str) {
339339
const STRING_HEADER* str_header = str.GetHeader();
340340
int str_used = str_header->used_;
341341

342-
GetHeader()->used_ = 0; // clear since ensure doesnt need to copy data
342+
GetHeader()->used_ = 0; // clear since ensure doesn't need to copy data
343343
char* this_cstr = ensure_cstr(str_used);
344344
STRING_HEADER* this_header = GetHeader();
345345

@@ -398,7 +398,7 @@ STRING & STRING::operator=(const char* cstr) {
398398
if (cstr) {
399399
int len = strlen(cstr) + 1;
400400

401-
this_header->used_ = 0; // dont bother copying data if need to realloc
401+
this_header->used_ = 0; // don't bother copying data if need to realloc
402402
char* this_cstr = ensure_cstr(len);
403403
this_header = GetHeader(); // for realloc
404404
memcpy(this_cstr, cstr, len);
@@ -416,7 +416,7 @@ STRING & STRING::operator=(const char* cstr) {
416416

417417
void STRING::assign(const char *cstr, int len) {
418418
STRING_HEADER* this_header = GetHeader();
419-
this_header->used_ = 0; // dont bother copying data if need to realloc
419+
this_header->used_ = 0; // don't bother copying data if need to realloc
420420
char* this_cstr = ensure_cstr(len + 1); // +1 for '\0'
421421

422422
this_header = GetHeader(); // for realloc

ccutil/tessdatamanager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ bool TessdataManager::Init(const char *data_file_name, int debug_level) {
5151
sizeof(actual_tessdata_num_entries_));
5252
}
5353
if (actual_tessdata_num_entries_ > TESSDATA_NUM_ENTRIES) {
54-
// For forward compatability, truncate to the number we can handle.
54+
// For forward compatibility, truncate to the number we can handle.
5555
actual_tessdata_num_entries_ = TESSDATA_NUM_ENTRIES;
5656
}
5757
fread(offset_table_, sizeof(inT64),

ccutil/tessdatamanager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class TessdataManager {
282282
* same or smaller than TESSDATA_NUM_ENTRIES, but can never be larger,
283283
* since then it would be impossible to interpret the type of tessdata at
284284
* indices same and higher than TESSDATA_NUM_ENTRIES.
285-
* This parameter is used to allow for backward compatiblity
285+
* This parameter is used to allow for backward compatibility
286286
* when new tessdata types are introduced.
287287
*/
288288
inT32 actual_tessdata_num_entries_;

0 commit comments

Comments
 (0)