Skip to content

Commit edf765b

Browse files
committed
Remove unneeded const qualifiers
This fixes compiler warnings like this one: api/baseapi.h:739:32: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent eb34cb1 commit edf765b

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

api/baseapi.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -736,11 +736,11 @@ class TESS_API TessBaseAPI {
736736
*/
737737
static void NormalizeTBLOB(TBLOB *tblob, ROW *row, bool numeric_mode);
738738

739-
Tesseract* const tesseract() const {
739+
Tesseract* tesseract() const {
740740
return tesseract_;
741741
}
742742

743-
OcrEngineMode const oem() const {
743+
OcrEngineMode oem() const {
744744
return last_oem_requested_;
745745
}
746746

ccmain/osdetect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ bool ScriptDetector::must_stop(int orientation) {
560560
// Helper method to convert an orientation index to its value in degrees.
561561
// The value represents the amount of clockwise rotation in degrees that must be
562562
// applied for the text to be upright (readable).
563-
const int OrientationIdToValue(const int& id) {
563+
int OrientationIdToValue(const int& id) {
564564
switch (id) {
565565
case 0:
566566
return 0;

ccmain/osdetect.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,6 @@ bool os_detect_blob(BLOBNBOX* bbox, OrientationDetector* o,
134134
// Helper method to convert an orientation index to its value in degrees.
135135
// The value represents the amount of clockwise rotation in degrees that must be
136136
// applied for the text to be upright (readable).
137-
TESS_API const int OrientationIdToValue(const int& id);
137+
TESS_API int OrientationIdToValue(const int& id);
138138

139139
#endif // TESSERACT_CCMAIN_OSDETECT_H__

ccstruct/boxword.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class BoxWord {
8282
const TBOX& bounding_box() const {
8383
return bbox_;
8484
}
85-
const int length() const {
85+
int length() const {
8686
return length_;
8787
}
8888
const TBOX& BlobBox(int index) const {

ccstruct/pageres.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class WERD_RES : public ELIST_LINK {
339339
// This matters for mirrorable characters such as parentheses. We recognize
340340
// characters purely based on their shape on the page, and by default produce
341341
// the corresponding unicode for a left-to-right context.
342-
const char* const BestUTF8(int blob_index, bool in_rtl_context) const {
342+
const char* BestUTF8(int blob_index, bool in_rtl_context) const {
343343
if (blob_index < 0 || best_choice == NULL ||
344344
blob_index >= best_choice->length())
345345
return NULL;
@@ -352,7 +352,7 @@ class WERD_RES : public ELIST_LINK {
352352
return uch_set->id_to_unichar_ext(id);
353353
}
354354
// Returns the UTF-8 string for the given blob index in the raw_choice word.
355-
const char* const RawUTF8(int blob_index) const {
355+
const char* RawUTF8(int blob_index) const {
356356
if (blob_index < 0 || blob_index >= raw_choice->length())
357357
return NULL;
358358
UNICHAR_ID id = raw_choice->unichar_id(blob_index);

ccstruct/ratngs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class WERD_CHOICE : public ELIST_LINK {
309309
inline const UNICHAR_ID *unichar_ids() const {
310310
return unichar_ids_;
311311
}
312-
inline const UNICHAR_ID unichar_id(int index) const {
312+
inline UNICHAR_ID unichar_id(int index) const {
313313
assert(index < length_);
314314
return unichar_ids_[index];
315315
}

ccutil/unicharset.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ void UNICHARSET::reserve(int unichars_number) {
190190
}
191191
}
192192

193-
const UNICHAR_ID
193+
UNICHAR_ID
194194
UNICHARSET::unichar_to_id(const char* const unichar_repr) const {
195195
return ids.contains(unichar_repr) ?
196196
ids.unichar_to_id(unichar_repr) : INVALID_UNICHAR_ID;
197197
}
198198

199-
const UNICHAR_ID UNICHARSET::unichar_to_id(const char* const unichar_repr,
200-
int length) const {
199+
UNICHAR_ID UNICHARSET::unichar_to_id(const char* const unichar_repr,
200+
int length) const {
201201
assert(length > 0 && length <= UNICHAR_LEN);
202202
return ids.contains(unichar_repr, length) ?
203203
ids.unichar_to_id(unichar_repr, length) : INVALID_UNICHAR_ID;
@@ -263,15 +263,15 @@ bool UNICHARSET::encode_string(const char* str, bool give_up_on_failure,
263263
return perfect;
264264
}
265265

266-
const char* const UNICHARSET::id_to_unichar(UNICHAR_ID id) const {
266+
const char* UNICHARSET::id_to_unichar(UNICHAR_ID id) const {
267267
if (id == INVALID_UNICHAR_ID) {
268268
return INVALID_UNICHAR;
269269
}
270270
ASSERT_HOST(id < this->size());
271271
return unichars[id].representation;
272272
}
273273

274-
const char* const UNICHARSET::id_to_unichar_ext(UNICHAR_ID id) const {
274+
const char* UNICHARSET::id_to_unichar_ext(UNICHAR_ID id) const {
275275
if (id == INVALID_UNICHAR_ID) {
276276
return INVALID_UNICHAR;
277277
}

ccutil/unicharset.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ class UNICHARSET {
177177

178178
// Return the UNICHAR_ID of a given unichar representation within the
179179
// UNICHARSET.
180-
const UNICHAR_ID unichar_to_id(const char* const unichar_repr) const;
180+
UNICHAR_ID unichar_to_id(const char* const unichar_repr) const;
181181

182182
// Return the UNICHAR_ID of a given unichar representation within the
183183
// UNICHARSET. Only the first length characters from unichar_repr are used.
184-
const UNICHAR_ID unichar_to_id(const char* const unichar_repr,
184+
UNICHAR_ID unichar_to_id(const char* const unichar_repr,
185185
int length) const;
186186

187187
// Return the minimum number of bytes that matches a legal UNICHAR_ID,
@@ -215,13 +215,13 @@ class UNICHARSET {
215215

216216
// Return the unichar representation corresponding to the given UNICHAR_ID
217217
// within the UNICHARSET.
218-
const char* const id_to_unichar(UNICHAR_ID id) const;
218+
const char* id_to_unichar(UNICHAR_ID id) const;
219219

220220
// Return the UTF8 representation corresponding to the given UNICHAR_ID after
221221
// resolving any private encodings internal to Tesseract. This method is
222222
// preferable to id_to_unichar for outputting text that will be visible to
223223
// external applications.
224-
const char* const id_to_unichar_ext(UNICHAR_ID id) const;
224+
const char* id_to_unichar_ext(UNICHAR_ID id) const;
225225

226226
// Return a STRING that reformats the utf8 str into the str followed
227227
// by its hex unicodes.

dict/dict.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,11 @@ class Dict {
397397
}
398398

399399
inline void SetWildcardID(UNICHAR_ID id) { wildcard_unichar_id_ = id; }
400-
inline const UNICHAR_ID WildcardID() const {
400+
inline UNICHAR_ID WildcardID() const {
401401
return wildcard_unichar_id_;
402402
}
403403
/// Return the number of dawgs in the dawgs_ vector.
404-
inline const int NumDawgs() const { return dawgs_.size(); }
404+
inline int NumDawgs() const { return dawgs_.size(); }
405405
/// Return i-th dawg pointer recorded in the dawgs_ vector.
406406
inline const Dawg *GetDawg(int index) const { return dawgs_[index]; }
407407
/// Return the points to the punctuation dawg.

textord/devanagari_processing.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class PixelHistogram {
4141
length_ = 0;
4242
}
4343

44-
int* const hist() const {
44+
int* hist() const {
4545
return hist_;
4646
}
4747

0 commit comments

Comments
 (0)