#162 closed defect (fixed)
Replace finite function with C++ <limits> features
Reported by: | mloskot | Owned by: | mloskot |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | main |
Severity: | Significant | Keywords: | c99 finite math numeric_limits |
Cc: |
Description
In HTCoordinate.cpp:197 file finite function is used. The finite() function is obsolete also in POSIX and replaced with isfinite macro. Unfortunately, isfinite() was added in C99, so it's not available in ISO C++/2003.
Here is proposed solution that conforms to C++ standard, replace line 197:
f ( ! finite(static_cast<double>(a)) )
with following:
// Put this next to existing #include directives #include <cmath> #include <limits> // replace line 197 with this line if (std::fabs(a) > std::numeric_limits<double>::max())
Originally reported as OSX 10.5 compile problem by William Kyngesburye
Change History (6)
comment:1 by , 16 years ago
Summary: | Replace finite function with C++ limitsx → Replace finite function with C++ <limits> features |
---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
comment:4 by , 16 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:5 by , 16 years ago
Keywords: | numeric_limits added |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
I've just applied this fix to trunk (r2043)
Note:
See TracTickets
for help on using tickets.
That did it. Note, there are two places where finite() is used, line 197 (getX()) and line 211 (getY()).