Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 672e4b5

Browse files
committed
Use MPL_notisfinite in place of MPL_isnan
svn path=/trunk/matplotlib/; revision=5980
1 parent b59004d commit 672e4b5

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/MPL_isnan.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,15 @@ typedef long long MPL_Int64;
6969
( (( MPL_U64(u) & 0x7ff0000000000000i64) != 0x7ff0000000000000i64)) ? 1:0
7070
#endif
7171
#endif /* MPL_isfinite64 */
72+
73+
#if !defined(MPL_notisfinite64)
74+
#if !defined(_MSC_VER)
75+
#define MPL_notisfinite64(u) \
76+
( (( MPL_U64(u) & 0x7ff0000000000000LL) != 0x7ff0000000000000LL)) ? 0:1
77+
#else
78+
#define MPL_notisfinite64(u) \
79+
( (( MPL_U64(u) & 0x7ff0000000000000i64) != 0x7ff0000000000000i64)) ? 0:1
80+
#endif
81+
#endif /* MPL_notisfinite64 */
82+
83+

src/agg_py_path_iterator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ class PathIterator
7676
if (m_iterator >= m_total_vertices) return agg::path_cmd_stop;
7777
unsigned code = vertex_with_code(m_iterator++, x, y);
7878

79-
if (MPL_isnan64(*x) || MPL_isnan64(*y)) {
79+
if (MPL_notisfinite64(*x) || MPL_notisfinite64(*y)) {
8080
do {
8181
if (m_iterator < m_total_vertices) {
8282
vertex(m_iterator++, x, y);
8383
} else {
8484
return agg::path_cmd_stop;
8585
}
86-
} while (MPL_isnan64(*x) || MPL_isnan64(*y));
86+
} while (MPL_notisfinite64(*x) || MPL_notisfinite64(*y));
8787
return agg::path_cmd_move_to;
8888
}
8989

0 commit comments

Comments
 (0)