Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a couple minor compiler warnings #2039

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ccstruct/normalis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ void DENORM::DenormTransform(const DENORM* last_denorm, const FCOORD& pt,
// Normalize a blob using blob transformations. Less accurate, but
// more accurately copies the old way.
void DENORM::LocalNormBlob(TBLOB* blob) const {
TBOX blob_box = blob->bounding_box();
ICOORD translation(-IntCastRounded(x_origin_), -IntCastRounded(y_origin_));
blob->Move(translation);
if (y_scale_ != 1.0f)
Expand Down
2 changes: 1 addition & 1 deletion src/ccutil/genericvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ template <typename T>
bool GenericVector<T>::SkipDeSerialize(tesseract::TFile* fp) {
uint32_t reserved;
if (fp->FReadEndian(&reserved, sizeof(reserved), 1) != 1) return false;
return fp->FRead(nullptr, sizeof(T), reserved) == reserved;
return (uint32_t)fp->FRead(nullptr, sizeof(T), reserved) == reserved;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use C++ type casts instead of C type casts in future commits because C type casts also cause a compiler warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry. I've been doing a lot of JS, Rust, and OCaml lately so I've got a few different ideas of what type casting looks like floating around in my head.

}

// Writes a vector of classes to the given file. Assumes the existence of
Expand Down
1 change: 0 additions & 1 deletion src/textord/colpartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,6 @@ bool ColPartition::MarkAsLeaderIfMonospaced() {
bool modified_blob_list = false;
for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
BLOBNBOX* blob = it.data();
TBOX box = blob->bounding_box();
// If the first or last blob is spaced too much, don't mark it.
if (it.at_first()) {
int gap = it.data_relative(1)->bounding_box().left() -
Expand Down