Fix compiler warnings [-Wold-style-cast]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2024-05-12 18:46:42 +02:00
parent 24dd72603b
commit 1644205d9e
2 changed files with 10 additions and 10 deletions

View File

@ -77,7 +77,7 @@ public:
/// find sq length
float sqlength() const {
return (float)(xcoord * xcoord + ycoord * ycoord);
return static_cast<float>(xcoord * xcoord + ycoord * ycoord);
}
/// find length
@ -101,7 +101,7 @@ public:
/// find angle
float angle() const {
return (float)std::atan2(ycoord, xcoord);
return std::atan2(static_cast<float>(ycoord), static_cast<float>(xcoord));
}
/// test equality

View File

@ -34,10 +34,10 @@
#ifndef __GNUC__
# ifdef _WIN32
# define NO_EDGE (int64_t)0xffffffffffffffffi64
# define NO_EDGE static_cast<int64_t>(0xffffffffffffffffi64)
# endif /*_WIN32*/
#else
# define NO_EDGE (int64_t)0xffffffffffffffffll
# define NO_EDGE static_cast<int64_t>(0xffffffffffffffffll)
#endif /*__GNUC__*/
namespace tesseract {
@ -74,12 +74,12 @@ enum DawgType {
C o n s t a n t s
----------------------------------------------------------------------*/
#define FORWARD_EDGE (int32_t)0
#define BACKWARD_EDGE (int32_t)1
#define MAX_NODE_EDGES_DISPLAY (int64_t)100
#define MARKER_FLAG (int64_t)1
#define DIRECTION_FLAG (int64_t)2
#define WERD_END_FLAG (int64_t)4
#define FORWARD_EDGE static_cast<int32_t>(0)
#define BACKWARD_EDGE static_cast<int32_t>(1)
#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)
#define LETTER_START_BIT 0
#define NUM_FLAG_BITS 3
#define REFFORMAT "%" PRId64