mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
Fix compiler warnings [-Wold-style-cast]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
24dd72603b
commit
1644205d9e
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user