Skip to content

Commit

Permalink
ccutil: Fix typos in comments and strings
Browse files Browse the repository at this point in the history
Most of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Sep 14, 2015
1 parent bef8cad commit 539b7fb
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions ccutil/clst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ()) {
Expand Down
20 changes: 10 additions & 10 deletions ccutil/clst.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
**********************************************************************/

Expand Down Expand Up @@ -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.
**********************************************************************/

Expand Down Expand Up @@ -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
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:
Expand Down Expand Up @@ -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 ); } \
Expand Down Expand Up @@ -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*/ \
Expand Down
6 changes: 3 additions & 3 deletions ccutil/elst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 *)
**********************************************************************/

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ()) {
Expand Down
16 changes: 8 additions & 8 deletions ccutil/elst.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
**********************************************************************/

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
**********************************************************************/

Expand Down Expand Up @@ -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.
**********************************************************************/

Expand Down Expand Up @@ -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
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:
Expand Down Expand Up @@ -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) { \
Expand Down
6 changes: 3 additions & 3 deletions ccutil/elst2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 *)
**********************************************************************/

Expand Down Expand Up @@ -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*),
Expand Down Expand Up @@ -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 ()) {
Expand Down
18 changes: 9 additions & 9 deletions ccutil/elst2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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*),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
**********************************************************************/

Expand Down Expand Up @@ -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.
**********************************************************************/

Expand Down Expand Up @@ -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
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:
Expand Down Expand Up @@ -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 ); } \
Expand Down Expand Up @@ -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*/ \
Expand Down
2 changes: 1 addition & 1 deletion ccutil/errcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ccutil/genericvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
// 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 <typename T>
Expand Down
2 changes: 1 addition & 1 deletion ccutil/lsterr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ccutil/ocrclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
8 changes: 4 additions & 4 deletions ccutil/strngs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ccutil/tessdatamanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion ccutil/tessdatamanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit 539b7fb

Please sign in to comment.