From 3a385569fe19ebf6c8ba1157bfb1cda90e0abfbe Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 14 Sep 2015 22:09:18 +0200 Subject: [PATCH] ccutil: Fix typos in comments and strings Most of them were found by codespell. Signed-off-by: Stefan Weil --- ccutil/clst.cpp | 4 ++-- ccutil/clst.h | 20 ++++++++++---------- ccutil/elst.cpp | 6 +++--- ccutil/elst.h | 16 ++++++++-------- ccutil/elst2.cpp | 6 +++--- ccutil/elst2.h | 18 +++++++++--------- ccutil/errcode.h | 2 +- ccutil/genericvector.h | 2 +- ccutil/lsterr.h | 2 +- ccutil/ocrclass.h | 2 +- ccutil/strngs.cpp | 8 ++++---- ccutil/tessdatamanager.cpp | 2 +- ccutil/tessdatamanager.h | 2 +- 13 files changed, 45 insertions(+), 45 deletions(-) diff --git a/ccutil/clst.cpp b/ccutil/clst.cpp index 60f88d370..e71cc2010 100644 --- a/ccutil/clst.cpp +++ b/ccutil/clst.cpp @@ -190,7 +190,7 @@ const void *, const void *)) { // Assuming list has been sorted already, insert new_data to // keep the list sorted according to the same comparison function. -// Comparision function is the same as used by sort, i.e. uses double +// Comparison function is the same as used by sort, i.e. uses double // indirection. Time is O(1) to add to beginning or end. // Time is linear to add pre-sorted items to an empty list. // If unique, then don't add duplicate entries. @@ -513,7 +513,7 @@ CLIST_LINK *CLIST_ITERATOR::extract_sublist( //from temp_it.mark_cycle_pt (); do { //walk sublist - if (temp_it.cycled_list ()) //cant find end pt + if (temp_it.cycled_list ()) //can't find end pt BAD_SUBLIST.error ("CLIST_ITERATOR.extract_sublist", ABORT, NULL); if (temp_it.at_last ()) { diff --git a/ccutil/clst.h b/ccutil/clst.h index 89c436994..a209ac11c 100644 --- a/ccutil/clst.h +++ b/ccutil/clst.h @@ -51,11 +51,11 @@ class DLLSYM CLIST_LINK } CLIST_LINK( //copy constructor - const CLIST_LINK &) { //dont copy link + const CLIST_LINK &) { //don't copy link data = next = NULL; } - void operator= ( //dont copy links + void operator= ( //don't copy links const CLIST_LINK &) { data = next = NULL; } @@ -89,7 +89,7 @@ class DLLSYM CLIST void internal_deep_clear ( //destroy all links void (*zapper) (void *)); //ptr to zapper functn - void shallow_clear(); //clear list but dont + void shallow_clear(); //clear list but don't //delete data elements bool empty() const { //is list empty? @@ -117,7 +117,7 @@ class DLLSYM CLIST // Assuming list has been sorted already, insert new_data to // keep the list sorted according to the same comparison function. - // Comparision function is the same as used by sort, i.e. uses double + // Comparison function is the same as used by sort, i.e. uses double // indirection. Time is O(1) to add to beginning or end. // Time is linear to add pre-sorted items to an empty list. // If unique, then don't add duplicate entries. @@ -232,7 +232,7 @@ class DLLSYM CLIST_ITERATOR BOOL8 cycled_list(); //Completed a cycle? void add_to_end( //add at end & - void *new_data); //dont move + void *new_data); //don't move void exchange( //positions of 2 links CLIST_ITERATOR *other_it); //other iterator @@ -437,7 +437,7 @@ inline void CLIST_ITERATOR::add_before_then_move( // element to add /*********************************************************************** * CLIST_ITERATOR::add_before_stay_put * - * Add a new element to the list before the current element but dont move the + * Add a new element to the list before the current element but don't move the * iterator to the new element. **********************************************************************/ @@ -485,7 +485,7 @@ inline void CLIST_ITERATOR::add_before_stay_put( // element to add /*********************************************************************** * CLIST_ITERATOR::add_list_after * - * Insert another list to this list after the current element but dont move the + * Insert another list to this list after the current element but don't move the * iterator. **********************************************************************/ @@ -836,7 +836,7 @@ Replace with "". may be an arbitrary number of tokens CLASSNAME is assumed to be the name of a class to be used in a CONS list -NOTE: Because we dont use virtual functions in the list code, the list code +NOTE: Because we don't use virtual functions in the list code, the list code will NOT work correctly for classes derived from this. The macro generates: @@ -885,7 +885,7 @@ public: \ CLASSNAME##_CLIST():CLIST() {} \ /* constructor */ \ \ - CLASSNAME##_CLIST( /* dont construct */ \ + CLASSNAME##_CLIST( /* don't construct */ \ const CLASSNAME##_CLIST&) /*by initial assign*/ \ { DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_CLIST ), \ ABORT, NULL ); } \ @@ -963,7 +963,7 @@ CLISTIZEH_C( CLASSNAME ) * A function which can delete a CLASSNAME element. This is passed to the \ * generic deep_clear list member function so that when a list is cleared the \ * elements on the list are properly destroyed from the base class, even \ -* though we dont use a virtual destructor function. \ +* though we don't use a virtual destructor function. \ **********************************************************************/ \ \ DLLSYM void CLASSNAME##_c1_zapper( /*delete a link*/ \ diff --git a/ccutil/elst.cpp b/ccutil/elst.cpp index 7762220d6..67a8ab0cb 100644 --- a/ccutil/elst.cpp +++ b/ccutil/elst.cpp @@ -117,7 +117,7 @@ inT32 ELIST::length() const { // count elements * ELIST::sort * * Sort elements on list - * NB If you dont like the const declarations in the comparator, coerce yours: + * NB If you don't like the const declarations in the comparator, coerce yours: * ( int (*)(const void *, const void *) **********************************************************************/ @@ -161,7 +161,7 @@ const void *, const void *)) { // Assuming list has been sorted already, insert new_link to // keep the list sorted according to the same comparison function. -// Comparision function is the same as used by sort, i.e. uses double +// Comparison function is the same as used by sort, i.e. uses double // indirection. Time is O(1) to add to beginning or end. // Time is linear to add pre-sorted items to an empty list. // 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 temp_it.mark_cycle_pt (); do { //walk sublist - if (temp_it.cycled_list ()) //cant find end pt + if (temp_it.cycled_list ()) //can't find end pt BAD_SUBLIST.error ("ELIST_ITERATOR.extract_sublist", ABORT, NULL); if (temp_it.at_last ()) { diff --git a/ccutil/elst.h b/ccutil/elst.h index dcc1552d1..492c03acb 100644 --- a/ccutil/elst.h +++ b/ccutil/elst.h @@ -67,7 +67,7 @@ The implementation of lists is very careful about space and speed overheads. This is why many embedded lists are provided. The same concerns mean that in-line type coercion is done, rather than use virtual functions. This is cumbersome in that each data type to be listed requires its own iterator and -list class - though macros can gererate these. It also prevents heterogenous +list class - though macros can gererate these. It also prevents heterogeneous lists. **********************************************************************/ @@ -98,7 +98,7 @@ class DLLSYM ELIST_LINK next = NULL; } - void operator= ( //dont copy links + void operator= ( //don't copy links const ELIST_LINK &) { next = NULL; } @@ -158,7 +158,7 @@ class DLLSYM ELIST // Assuming list has been sorted already, insert new_link to // keep the list sorted according to the same comparison function. - // Comparision function is the same as used by sort, i.e. uses double + // Comparison function is the same as used by sort, i.e. uses double // indirection. Time is O(1) to add to beginning or end. // Time is linear to add pre-sorted items to an empty list. // If unique is set to true and comparator() returns 0 (an entry with the @@ -274,7 +274,7 @@ class DLLSYM ELIST_ITERATOR bool cycled_list(); //Completed a cycle? void add_to_end( //add at end & - ELIST_LINK *new_link); //dont move + ELIST_LINK *new_link); //don't move void exchange( //positions of 2 links ELIST_ITERATOR *other_it); //other iterator @@ -470,7 +470,7 @@ inline void ELIST_ITERATOR::add_before_then_move( // element to add /*********************************************************************** * ELIST_ITERATOR::add_before_stay_put * - * Add a new element to the list before the current element but dont move the + * Add a new element to the list before the current element but don't move the * iterator to the new element. **********************************************************************/ @@ -515,7 +515,7 @@ inline void ELIST_ITERATOR::add_before_stay_put( // element to add /*********************************************************************** * ELIST_ITERATOR::add_list_after * - * Insert another list to this list after the current element but dont move the + * Insert another list to this list after the current element but don't move the * iterator. **********************************************************************/ @@ -868,7 +868,7 @@ Replace with "". may be an arbitrary number of tokens CLASSNAME is assumed to be the name of a class which has a baseclass of ELIST_LINK. -NOTE: Because we dont use virtual functions in the list code, the list code +NOTE: Because we don't use virtual functions in the list code, the list code will NOT work correctly for classes derived from this. The macros generate: @@ -999,7 +999,7 @@ ELISTIZEH_C( CLASSNAME ) * A function which can delete a CLASSNAME element. This is passed to the \ * generic clear list member function so that when a list is cleared the \ * elements on the list are properly destroyed from the base class, even \ -* though we dont use a virtual destructor function. \ +* though we don't use a virtual destructor function. \ **********************************************************************/ \ \ DLLSYM void CLASSNAME##_zapper(ELIST_LINK* link) { \ diff --git a/ccutil/elst2.cpp b/ccutil/elst2.cpp index 7055686fb..fe5b77e25 100644 --- a/ccutil/elst2.cpp +++ b/ccutil/elst2.cpp @@ -118,7 +118,7 @@ inT32 ELIST2::length() const { // count elements * ELIST2::sort * * Sort elements on list - * NB If you dont like the const declarations in the comparator, coerce yours: + * NB If you don't like the const declarations in the comparator, coerce yours: * ( int (*)(const void *, const void *) **********************************************************************/ @@ -162,7 +162,7 @@ const void *, const void *)) { // Assuming list has been sorted already, insert new_link to // keep the list sorted according to the same comparison function. -// Comparision function is the same as used by sort, i.e. uses double +// Comparison function is the same as used by sort, i.e. uses double // indirection. Time is O(1) to add to beginning or end. // Time is linear to add pre-sorted items to an empty list. void ELIST2::add_sorted(int comparator(const void*, const void*), @@ -475,7 +475,7 @@ ELIST2_LINK *ELIST2_ITERATOR::extract_sublist( //fr temp_it.mark_cycle_pt (); do { //walk sublist - if (temp_it.cycled_list ()) //cant find end pt + if (temp_it.cycled_list ()) //can't find end pt BAD_SUBLIST.error ("ELIST2_ITERATOR.extract_sublist", ABORT, NULL); if (temp_it.at_last ()) { diff --git a/ccutil/elst2.h b/ccutil/elst2.h index 7201750dc..f7ea6ed07 100644 --- a/ccutil/elst2.h +++ b/ccutil/elst2.h @@ -69,11 +69,11 @@ class DLLSYM ELIST2_LINK } ELIST2_LINK( //copy constructor - const ELIST2_LINK &) { //dont copy link + const ELIST2_LINK &) { //don't copy link prev = next = NULL; } - void operator= ( //dont copy links + void operator= ( //don't copy links const ELIST2_LINK &) { prev = next = NULL; } @@ -133,7 +133,7 @@ class DLLSYM ELIST2 // Assuming list has been sorted already, insert new_link to // keep the list sorted according to the same comparison function. - // Comparision function is the same as used by sort, i.e. uses double + // Comparison function is the same as used by sort, i.e. uses double // indirection. Time is O(1) to add to beginning or end. // Time is linear to add pre-sorted items to an empty list. void add_sorted(int comparator(const void*, const void*), @@ -241,7 +241,7 @@ class DLLSYM ELIST2_ITERATOR BOOL8 cycled_list(); //Completed a cycle? void add_to_end( //add at end & - ELIST2_LINK *new_link); //dont move + ELIST2_LINK *new_link); //don't move void exchange( //positions of 2 links ELIST2_ITERATOR *other_it); //other iterator @@ -450,7 +450,7 @@ inline void ELIST2_ITERATOR::add_before_then_move( // element to add /*********************************************************************** * ELIST2_ITERATOR::add_before_stay_put * - * Add a new element to the list before the current element but dont move the + * Add a new element to the list before the current element but don't move the * iterator to the new element. **********************************************************************/ @@ -500,7 +500,7 @@ inline void ELIST2_ITERATOR::add_before_stay_put( // element to add /*********************************************************************** * ELIST2_ITERATOR::add_list_after * - * Insert another list to this list after the current element but dont move the + * Insert another list to this list after the current element but don't move the * iterator. **********************************************************************/ @@ -883,7 +883,7 @@ Replace with "". may be an arbitrary number of tokens CLASSNAME is assumed to be the name of a class which has a baseclass of ELIST2_LINK. -NOTE: Because we dont use virtual functions in the list code, the list code +NOTE: Because we don't use virtual functions in the list code, the list code will NOT work correctly for classes derived from this. The macro generates: @@ -927,7 +927,7 @@ public: \ CLASSNAME##_LIST():ELIST2() {} \ /* constructor */ \ \ - CLASSNAME##_LIST( /* dont construct */ \ + CLASSNAME##_LIST( /* don't construct */ \ const CLASSNAME##_LIST&) /*by initial assign*/\ { DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_LIST ), \ ABORT, NULL ); } \ @@ -1015,7 +1015,7 @@ ELIST2IZEH_C( CLASSNAME ) * A function which can delete a CLASSNAME element. This is passed to the \ * generic clear list member function so that when a list is cleared the \ * elements on the list are properly destroyed from the base class, even \ -* though we dont use a virtual destructor function. \ +* though we don't use a virtual destructor function. \ **********************************************************************/ \ \ DLLSYM void CLASSNAME##_zapper( /*delete a link*/ \ diff --git a/ccutil/errcode.h b/ccutil/errcode.h index 89385d2b9..69d4187a3 100644 --- a/ccutil/errcode.h +++ b/ccutil/errcode.h @@ -53,7 +53,7 @@ enum TessErrorLogCode { #define LOC_DOC_BLK_REJ 22 #define LOC_WRITE_RESULTS 23 #define LOC_ADAPTIVE 24 -/* DONT DEFINE ANY LOCATION > 31 !!! */ +/* DON'T DEFINE ANY LOCATION > 31 !!! */ /* Sub locatation determines whether pass2 was in normal mode or fix xht mode*/ #define SUBLOC_NORM 0 diff --git a/ccutil/genericvector.h b/ccutil/genericvector.h index 8433966bf..a0ca9e292 100644 --- a/ccutil/genericvector.h +++ b/ccutil/genericvector.h @@ -949,7 +949,7 @@ bool GenericVector::SerializeClasses(tesseract::TFile* fp) const { // Reads a vector of classes from the given file. Assumes the existence of // bool T::Deserialize(bool swap, FILE* fp) that returns false in case of -// error. Alse needs T::T() and T::T(constT&), as init_to_size is used in +// error. Also needs T::T() and T::T(constT&), as init_to_size is used in // this function. Returns false in case of error. // If swap is true, assumes a big/little-endian swap is needed. template diff --git a/ccutil/lsterr.h b/ccutil/lsterr.h index 6bcd7fead..42ed07e32 100644 --- a/ccutil/lsterr.h +++ b/ccutil/lsterr.h @@ -38,6 +38,6 @@ const ERRCODE NULL_PREV = "Previous element on the list is NULL"; const ERRCODE EMPTY_LIST = "List is empty"; const ERRCODE BAD_PARAMETER = "List parameter error"; const ERRCODE STILL_LINKED = -"Attemting to add an element with non NULL links, to a list"; +"Attempting to add an element with non NULL links, to a list"; #endif #endif diff --git a/ccutil/ocrclass.h b/ccutil/ocrclass.h index 37556b30b..9be184d59 100644 --- a/ccutil/ocrclass.h +++ b/ccutil/ocrclass.h @@ -21,7 +21,7 @@ * the HP OCR interface. * The code is designed to be used with either a C or C++ compiler. * The structures are designed to allow them to be used with any - * structure alignment upto 8. + * structure alignment up to 8. **********************************************************************/ #ifndef CCUTIL_OCRCLASS_H_ diff --git a/ccutil/strngs.cpp b/ccutil/strngs.cpp index 1c9769978..b44c54124 100644 --- a/ccutil/strngs.cpp +++ b/ccutil/strngs.cpp @@ -45,7 +45,7 @@ const int kMaxDoubleSize = 15; * * The collection of MACROS provide different implementations depending * on whether the string keeps track of its strlen or not so that this - * feature can be added in later when consumers dont modifify the string + * feature can be added in later when consumers don't modify the string **********************************************************************/ // Smallest string to allocate by default @@ -339,7 +339,7 @@ STRING& STRING::operator=(const STRING& str) { const STRING_HEADER* str_header = str.GetHeader(); int str_used = str_header->used_; - GetHeader()->used_ = 0; // clear since ensure doesnt need to copy data + GetHeader()->used_ = 0; // clear since ensure doesn't need to copy data char* this_cstr = ensure_cstr(str_used); STRING_HEADER* this_header = GetHeader(); @@ -398,7 +398,7 @@ STRING & STRING::operator=(const char* cstr) { if (cstr) { int len = strlen(cstr) + 1; - this_header->used_ = 0; // dont bother copying data if need to realloc + this_header->used_ = 0; // don't bother copying data if need to realloc char* this_cstr = ensure_cstr(len); this_header = GetHeader(); // for realloc memcpy(this_cstr, cstr, len); @@ -416,7 +416,7 @@ STRING & STRING::operator=(const char* cstr) { void STRING::assign(const char *cstr, int len) { STRING_HEADER* this_header = GetHeader(); - this_header->used_ = 0; // dont bother copying data if need to realloc + this_header->used_ = 0; // don't bother copying data if need to realloc char* this_cstr = ensure_cstr(len + 1); // +1 for '\0' this_header = GetHeader(); // for realloc diff --git a/ccutil/tessdatamanager.cpp b/ccutil/tessdatamanager.cpp index 032d5fee6..23d029bb4 100644 --- a/ccutil/tessdatamanager.cpp +++ b/ccutil/tessdatamanager.cpp @@ -51,7 +51,7 @@ bool TessdataManager::Init(const char *data_file_name, int debug_level) { sizeof(actual_tessdata_num_entries_)); } if (actual_tessdata_num_entries_ > TESSDATA_NUM_ENTRIES) { - // For forward compatability, truncate to the number we can handle. + // For forward compatibility, truncate to the number we can handle. actual_tessdata_num_entries_ = TESSDATA_NUM_ENTRIES; } fread(offset_table_, sizeof(inT64), diff --git a/ccutil/tessdatamanager.h b/ccutil/tessdatamanager.h index de3e59902..fd2685a1d 100644 --- a/ccutil/tessdatamanager.h +++ b/ccutil/tessdatamanager.h @@ -282,7 +282,7 @@ class TessdataManager { * same or smaller than TESSDATA_NUM_ENTRIES, but can never be larger, * since then it would be impossible to interpret the type of tessdata at * indices same and higher than TESSDATA_NUM_ENTRIES. - * This parameter is used to allow for backward compatiblity + * This parameter is used to allow for backward compatibility * when new tessdata types are introduced. */ inT32 actual_tessdata_num_entries_;