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 some compiler warnings #4245

Merged
merged 5 commits into from
May 20, 2024
Merged

Fix some compiler warnings #4245

merged 5 commits into from
May 20, 2024

Conversation

stweil
Copy link
Contributor

@stweil stweil commented May 19, 2024

No description provided.

- Use conditional compilation for variables which might be useful for debugging.
- Remove all other unused variables.

Signed-off-by: Stefan Weil <[email protected]>
This also fixes several compiler warnings ([-Wimplicit-float-conversion],
[-Wdouble-promotion]).

Signed-off-by: Stefan Weil <[email protected]>
#define MAX_NODE_EDGES_DISPLAY static_cast<int64_t>(100)
#define MARKER_FLAG static_cast<int64_t>(1)
#define DIRECTION_FLAG static_cast<int64_t>(2)
#define WERD_END_FLAG static_cast<int64_t>(4)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to replace with inline vars? constexpr inlines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think so (it the compiler produces the same efficient code). We could consider such a change for more macros in the future.

@stweil stweil merged commit 0366613 into tesseract-ocr:main May 20, 2024
7 checks passed
@stweil stweil deleted the warnings branch May 20, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants