ccstruct/werd.cpp: Fix compiler warnings

Compiler warnings from clang:

src/ccstruct/werd.cpp:128:4: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/werd.cpp:394:18: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/werd.cpp:394:27: warning:
 cast from 'const void *' to 'WERD **' drops const qualifier [-Wcast-qual]
src/ccstruct/werd.cpp:395:18: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/werd.cpp:395:27: warning:
 cast from 'const void *' to 'WERD **' drops const qualifier [-Wcast-qual]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-09-03 11:37:41 +02:00
parent 4934b2e8eb
commit e74c88a4d3

View File

@ -125,7 +125,7 @@ WERD::WERD(C_BLOB_LIST * blob_list, //< In word order
while (!end_it.at_last ())
end_it.forward (); //move to last
((C_BLOB_LIST *) (&cblobs))->assign_to_sublist (&start_it, &end_it);
(reinterpret_cast<C_BLOB_LIST*>(&cblobs))->assign_to_sublist(&start_it, &end_it);
//move to our list
blanks = clone->blanks;
// fprintf(stderr,"Wrong constructor!!!!\n");
@ -391,8 +391,8 @@ WERD & WERD::operator= (const WERD & source) {
*/
int word_comparator(const void *word1p, const void *word2p) {
WERD *word1 = *(WERD **)word1p;
WERD *word2 = *(WERD **)word2p;
const WERD *word1 = *reinterpret_cast<const WERD* const*>(word1p);
const WERD *word2 = *reinterpret_cast<const WERD* const*>(word2p);
return word1->bounding_box().left() - word2->bounding_box().left();
}