mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Fix compiler warnings for copy constructors
gcc reports these warnings with -Wextra: ccstruct/pageres.h:330:3: warning: base class 'class ELIST_LINK' should be explicitly initialized in the copy constructor [-Wextra] ccstruct/ratngs.cpp:115:1: warning: base class 'class ELIST_LINK' should be explicitly initialized in the copy constructor [-Wextra] ccstruct/ratngs.h:291:3: warning: base class 'class ELIST_LINK' should be explicitly initialized in the copy constructor [-Wextra] ccutil/genericvector.h:435:3: warning: base class 'class GenericVector<WERD_RES*>' should be explicitly initialized in the copy constructor [-Wextra] Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
40637384d3
commit
4a92ff5862
@ -327,7 +327,7 @@ class WERD_RES : public ELIST_LINK {
|
|||||||
}
|
}
|
||||||
// Deep copies everything except the ratings MATRIX.
|
// Deep copies everything except the ratings MATRIX.
|
||||||
// To get that use deep_copy below.
|
// To get that use deep_copy below.
|
||||||
WERD_RES(const WERD_RES &source) {
|
WERD_RES(const WERD_RES &source) : ELIST_LINK(source) {
|
||||||
InitPointers();
|
InitPointers();
|
||||||
*this = source; // see operator=
|
*this = source; // see operator=
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ BLOB_CHOICE::BLOB_CHOICE(UNICHAR_ID src_unichar_id, // character id
|
|||||||
*
|
*
|
||||||
* Constructor to build a BLOB_CHOICE from another BLOB_CHOICE.
|
* Constructor to build a BLOB_CHOICE from another BLOB_CHOICE.
|
||||||
*/
|
*/
|
||||||
BLOB_CHOICE::BLOB_CHOICE(const BLOB_CHOICE &other) {
|
BLOB_CHOICE::BLOB_CHOICE(const BLOB_CHOICE &other) : ELIST_LINK(other) {
|
||||||
unichar_id_ = other.unichar_id();
|
unichar_id_ = other.unichar_id();
|
||||||
rating_ = other.rating();
|
rating_ = other.rating();
|
||||||
certainty_ = other.certainty();
|
certainty_ = other.certainty();
|
||||||
|
@ -288,7 +288,7 @@ class WERD_CHOICE : public ELIST_LINK {
|
|||||||
src_certainty, src_permuter);
|
src_certainty, src_permuter);
|
||||||
}
|
}
|
||||||
WERD_CHOICE(const char *src_string, const UNICHARSET &unicharset);
|
WERD_CHOICE(const char *src_string, const UNICHARSET &unicharset);
|
||||||
WERD_CHOICE(const WERD_CHOICE &word) : unicharset_(word.unicharset_) {
|
WERD_CHOICE(const WERD_CHOICE &word) : ELIST_LINK(word), unicharset_(word.unicharset_) {
|
||||||
this->init(word.length());
|
this->init(word.length());
|
||||||
this->operator=(word);
|
this->operator=(word);
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ class PointerVector : public GenericVector<T*> {
|
|||||||
}
|
}
|
||||||
// Copy must be deep, as the pointers will be automatically deleted on
|
// Copy must be deep, as the pointers will be automatically deleted on
|
||||||
// destruction.
|
// destruction.
|
||||||
PointerVector(const PointerVector& other) {
|
PointerVector(const PointerVector& other) : GenericVector<T*>(other) {
|
||||||
this->init(other.size());
|
this->init(other.size());
|
||||||
this->operator+=(other);
|
this->operator+=(other);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user