ccutil: Fix typos in comments and strings

Most of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2015-09-14 22:09:18 +02:00 committed by Zdenko Podobný
parent fbc07c0f1b
commit 3a385569fe
13 changed files with 45 additions and 45 deletions

View File

@ -190,7 +190,7 @@ const void *, const void *)) {
// Assuming list has been sorted already, insert new_data to // Assuming list has been sorted already, insert new_data to
// keep the list sorted according to the same comparison function. // 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. // indirection. Time is O(1) to add to beginning or end.
// Time is linear to add pre-sorted items to an empty list. // Time is linear to add pre-sorted items to an empty list.
// If unique, then don't add duplicate entries. // If unique, then don't add duplicate entries.
@ -513,7 +513,7 @@ CLIST_LINK *CLIST_ITERATOR::extract_sublist( //from
temp_it.mark_cycle_pt (); temp_it.mark_cycle_pt ();
do { //walk sublist 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); BAD_SUBLIST.error ("CLIST_ITERATOR.extract_sublist", ABORT, NULL);
if (temp_it.at_last ()) { if (temp_it.at_last ()) {

View File

@ -51,11 +51,11 @@ class DLLSYM CLIST_LINK
} }
CLIST_LINK( //copy constructor CLIST_LINK( //copy constructor
const CLIST_LINK &) { //dont copy link const CLIST_LINK &) { //don't copy link
data = next = NULL; data = next = NULL;
} }
void operator= ( //dont copy links void operator= ( //don't copy links
const CLIST_LINK &) { const CLIST_LINK &) {
data = next = NULL; data = next = NULL;
} }
@ -89,7 +89,7 @@ class DLLSYM CLIST
void internal_deep_clear ( //destroy all links void internal_deep_clear ( //destroy all links
void (*zapper) (void *)); //ptr to zapper functn 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 //delete data elements
bool empty() const { //is list empty? bool empty() const { //is list empty?
@ -117,7 +117,7 @@ class DLLSYM CLIST
// Assuming list has been sorted already, insert new_data to // Assuming list has been sorted already, insert new_data to
// keep the list sorted according to the same comparison function. // 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. // indirection. Time is O(1) to add to beginning or end.
// Time is linear to add pre-sorted items to an empty list. // Time is linear to add pre-sorted items to an empty list.
// If unique, then don't add duplicate entries. // If unique, then don't add duplicate entries.
@ -232,7 +232,7 @@ class DLLSYM CLIST_ITERATOR
BOOL8 cycled_list(); //Completed a cycle? BOOL8 cycled_list(); //Completed a cycle?
void add_to_end( //add at end & void add_to_end( //add at end &
void *new_data); //dont move void *new_data); //don't move
void exchange( //positions of 2 links void exchange( //positions of 2 links
CLIST_ITERATOR *other_it); //other iterator 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 * 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. * 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 * 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. * iterator.
**********************************************************************/ **********************************************************************/
@ -836,7 +836,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
CLASSNAME is assumed to be the name of a class to be used in a CONS list 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. will NOT work correctly for classes derived from this.
The macro generates: The macro generates:
@ -885,7 +885,7 @@ public: \
CLASSNAME##_CLIST():CLIST() {} \ CLASSNAME##_CLIST():CLIST() {} \
/* constructor */ \ /* constructor */ \
\ \
CLASSNAME##_CLIST( /* dont construct */ \ CLASSNAME##_CLIST( /* don't construct */ \
const CLASSNAME##_CLIST&) /*by initial assign*/ \ const CLASSNAME##_CLIST&) /*by initial assign*/ \
{ DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_CLIST ), \ { DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_CLIST ), \
ABORT, NULL ); } \ ABORT, NULL ); } \
@ -963,7 +963,7 @@ CLISTIZEH_C( CLASSNAME )
* A function which can delete a CLASSNAME element. This is passed to the \ * 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 \ * 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 \ * 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*/ \ DLLSYM void CLASSNAME##_c1_zapper( /*delete a link*/ \

View File

@ -117,7 +117,7 @@ inT32 ELIST::length() const { // count elements
* ELIST::sort * ELIST::sort
* *
* Sort elements on list * 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 *) * ( int (*)(const void *, const void *)
**********************************************************************/ **********************************************************************/
@ -161,7 +161,7 @@ const void *, const void *)) {
// Assuming list has been sorted already, insert new_link to // Assuming list has been sorted already, insert new_link to
// keep the list sorted according to the same comparison function. // 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. // indirection. Time is O(1) to add to beginning or end.
// Time is linear to add pre-sorted items to an empty list. // 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 // 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 (); temp_it.mark_cycle_pt ();
do { //walk sublist 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); BAD_SUBLIST.error ("ELIST_ITERATOR.extract_sublist", ABORT, NULL);
if (temp_it.at_last ()) { if (temp_it.at_last ()) {

View File

@ -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 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 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 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. lists.
**********************************************************************/ **********************************************************************/
@ -98,7 +98,7 @@ class DLLSYM ELIST_LINK
next = NULL; next = NULL;
} }
void operator= ( //dont copy links void operator= ( //don't copy links
const ELIST_LINK &) { const ELIST_LINK &) {
next = NULL; next = NULL;
} }
@ -158,7 +158,7 @@ class DLLSYM ELIST
// Assuming list has been sorted already, insert new_link to // Assuming list has been sorted already, insert new_link to
// keep the list sorted according to the same comparison function. // 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. // indirection. Time is O(1) to add to beginning or end.
// Time is linear to add pre-sorted items to an empty list. // 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 // 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? bool cycled_list(); //Completed a cycle?
void add_to_end( //add at end & 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 void exchange( //positions of 2 links
ELIST_ITERATOR *other_it); //other iterator 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 * 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. * 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 * 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. * iterator.
**********************************************************************/ **********************************************************************/
@ -868,7 +868,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
CLASSNAME is assumed to be the name of a class which has a baseclass of CLASSNAME is assumed to be the name of a class which has a baseclass of
ELIST_LINK. 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. will NOT work correctly for classes derived from this.
The macros generate: The macros generate:
@ -999,7 +999,7 @@ ELISTIZEH_C( CLASSNAME )
* A function which can delete a CLASSNAME element. This is passed to the \ * 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 \ * 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 \ * 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) { \ DLLSYM void CLASSNAME##_zapper(ELIST_LINK* link) { \

View File

@ -118,7 +118,7 @@ inT32 ELIST2::length() const { // count elements
* ELIST2::sort * ELIST2::sort
* *
* Sort elements on list * 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 *) * ( int (*)(const void *, const void *)
**********************************************************************/ **********************************************************************/
@ -162,7 +162,7 @@ const void *, const void *)) {
// Assuming list has been sorted already, insert new_link to // Assuming list has been sorted already, insert new_link to
// keep the list sorted according to the same comparison function. // 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. // indirection. Time is O(1) to add to beginning or end.
// Time is linear to add pre-sorted items to an empty list. // Time is linear to add pre-sorted items to an empty list.
void ELIST2::add_sorted(int comparator(const void*, const void*), 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 (); temp_it.mark_cycle_pt ();
do { //walk sublist 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); BAD_SUBLIST.error ("ELIST2_ITERATOR.extract_sublist", ABORT, NULL);
if (temp_it.at_last ()) { if (temp_it.at_last ()) {

View File

@ -69,11 +69,11 @@ class DLLSYM ELIST2_LINK
} }
ELIST2_LINK( //copy constructor ELIST2_LINK( //copy constructor
const ELIST2_LINK &) { //dont copy link const ELIST2_LINK &) { //don't copy link
prev = next = NULL; prev = next = NULL;
} }
void operator= ( //dont copy links void operator= ( //don't copy links
const ELIST2_LINK &) { const ELIST2_LINK &) {
prev = next = NULL; prev = next = NULL;
} }
@ -133,7 +133,7 @@ class DLLSYM ELIST2
// Assuming list has been sorted already, insert new_link to // Assuming list has been sorted already, insert new_link to
// keep the list sorted according to the same comparison function. // 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. // indirection. Time is O(1) to add to beginning or end.
// Time is linear to add pre-sorted items to an empty list. // Time is linear to add pre-sorted items to an empty list.
void add_sorted(int comparator(const void*, const void*), void add_sorted(int comparator(const void*, const void*),
@ -241,7 +241,7 @@ class DLLSYM ELIST2_ITERATOR
BOOL8 cycled_list(); //Completed a cycle? BOOL8 cycled_list(); //Completed a cycle?
void add_to_end( //add at end & 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 void exchange( //positions of 2 links
ELIST2_ITERATOR *other_it); //other iterator 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 * 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. * 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 * 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. * iterator.
**********************************************************************/ **********************************************************************/
@ -883,7 +883,7 @@ Replace <parm> with "<parm>". <parm> may be an arbitrary number of tokens
CLASSNAME is assumed to be the name of a class which has a baseclass of CLASSNAME is assumed to be the name of a class which has a baseclass of
ELIST2_LINK. 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. will NOT work correctly for classes derived from this.
The macro generates: The macro generates:
@ -927,7 +927,7 @@ public: \
CLASSNAME##_LIST():ELIST2() {} \ CLASSNAME##_LIST():ELIST2() {} \
/* constructor */ \ /* constructor */ \
\ \
CLASSNAME##_LIST( /* dont construct */ \ CLASSNAME##_LIST( /* don't construct */ \
const CLASSNAME##_LIST&) /*by initial assign*/\ const CLASSNAME##_LIST&) /*by initial assign*/\
{ DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_LIST ), \ { DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_LIST ), \
ABORT, NULL ); } \ ABORT, NULL ); } \
@ -1015,7 +1015,7 @@ ELIST2IZEH_C( CLASSNAME )
* A function which can delete a CLASSNAME element. This is passed to the \ * 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 \ * 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 \ * 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*/ \ DLLSYM void CLASSNAME##_zapper( /*delete a link*/ \

View File

@ -53,7 +53,7 @@ enum TessErrorLogCode {
#define LOC_DOC_BLK_REJ 22 #define LOC_DOC_BLK_REJ 22
#define LOC_WRITE_RESULTS 23 #define LOC_WRITE_RESULTS 23
#define LOC_ADAPTIVE 24 #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*/ /* Sub locatation determines whether pass2 was in normal mode or fix xht mode*/
#define SUBLOC_NORM 0 #define SUBLOC_NORM 0

View File

@ -949,7 +949,7 @@ bool GenericVector<T>::SerializeClasses(tesseract::TFile* fp) const {
// Reads a vector of classes from the given file. Assumes the existence of // 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 // 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. // this function. Returns false in case of error.
// If swap is true, assumes a big/little-endian swap is needed. // If swap is true, assumes a big/little-endian swap is needed.
template <typename T> template <typename T>

View File

@ -38,6 +38,6 @@ const ERRCODE NULL_PREV = "Previous element on the list is NULL";
const ERRCODE EMPTY_LIST = "List is empty"; const ERRCODE EMPTY_LIST = "List is empty";
const ERRCODE BAD_PARAMETER = "List parameter error"; const ERRCODE BAD_PARAMETER = "List parameter error";
const ERRCODE STILL_LINKED = 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
#endif #endif

View File

@ -45,7 +45,7 @@ const int kMaxDoubleSize = 15;
* *
* The collection of MACROS provide different implementations depending * The collection of MACROS provide different implementations depending
* on whether the string keeps track of its strlen or not so that this * 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 // Smallest string to allocate by default
@ -339,7 +339,7 @@ STRING& STRING::operator=(const STRING& str) {
const STRING_HEADER* str_header = str.GetHeader(); const STRING_HEADER* str_header = str.GetHeader();
int str_used = str_header->used_; 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); char* this_cstr = ensure_cstr(str_used);
STRING_HEADER* this_header = GetHeader(); STRING_HEADER* this_header = GetHeader();
@ -398,7 +398,7 @@ STRING & STRING::operator=(const char* cstr) {
if (cstr) { if (cstr) {
int len = strlen(cstr) + 1; 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); char* this_cstr = ensure_cstr(len);
this_header = GetHeader(); // for realloc this_header = GetHeader(); // for realloc
memcpy(this_cstr, cstr, len); memcpy(this_cstr, cstr, len);
@ -416,7 +416,7 @@ STRING & STRING::operator=(const char* cstr) {
void STRING::assign(const char *cstr, int len) { void STRING::assign(const char *cstr, int len) {
STRING_HEADER* this_header = GetHeader(); 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' char* this_cstr = ensure_cstr(len + 1); // +1 for '\0'
this_header = GetHeader(); // for realloc this_header = GetHeader(); // for realloc

View File

@ -51,7 +51,7 @@ bool TessdataManager::Init(const char *data_file_name, int debug_level) {
sizeof(actual_tessdata_num_entries_)); sizeof(actual_tessdata_num_entries_));
} }
if (actual_tessdata_num_entries_ > 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; actual_tessdata_num_entries_ = TESSDATA_NUM_ENTRIES;
} }
fread(offset_table_, sizeof(inT64), fread(offset_table_, sizeof(inT64),

View File

@ -282,7 +282,7 @@ class TessdataManager {
* same or smaller than TESSDATA_NUM_ENTRIES, but can never be larger, * 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 * since then it would be impossible to interpret the type of tessdata at
* indices same and higher than TESSDATA_NUM_ENTRIES. * 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. * when new tessdata types are introduced.
*/ */
inT32 actual_tessdata_num_entries_; inT32 actual_tessdata_num_entries_;