From: Jean-Philippe Bruyère Date: Fri, 18 Feb 2022 20:05:22 +0000 (+0100) Subject: replace obsolete isnanf by isnan X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=aeb82cc12eeae59b4212bc828df517a4774a8bac;p=jp%2Fvkvg.git replace obsolete isnanf by isnan --- diff --git a/src/cross_os.h b/src/cross_os.h index 32f05f0..e2d4350 100644 --- a/src/cross_os.h +++ b/src/cross_os.h @@ -27,11 +27,9 @@ //disable warning on iostream functions on windows #define _CRT_SECURE_NO_WARNINGS #include "windows.h" - #if defined(_WIN32) - #define isnanf isnan - #else - #ifndef isnanf - #define isnanf _isnanf + #if defined(_WIN64) + #ifndef isnan + #define isnan _isnanf #endif #endif #define vkvg_inline __forceinline @@ -39,7 +37,6 @@ #define reset_warning (warn) #elif __APPLE__ #include - #define isnanf isnan #define vkvg_inline static #define disable_warning (warn) #define reset_warning (warn) @@ -47,9 +44,6 @@ #include #include #include - #ifndef isnanf - #define isnanf __isnanf - #endif #define vkvg_inline static inline __attribute((always_inline)) #define disable_warning (warn) #pragma GCC diagnostic ignored "-W"#warn #define reset_warning (warn) #pragma GCC diagnostic warning "-W"#warn diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index b1bd258..7ab182a 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -221,7 +221,7 @@ bool _path_is_closed (VkvgContext ctx, uint32_t ptrPath){ void _add_point (VkvgContext ctx, float x, float y){ if (_check_point_array(ctx)) return; - if (isnanf(x) || isnanf(y)) { + if (isnan(x) || isnan(y)) { LOG(VKVG_LOG_DEBUG, "_add_point: (%f, %f)\n", x, y); return; } @@ -1484,7 +1484,7 @@ void _elliptic_arc (VkvgContext ctx, float x1, float y1, float x2, float y2, boo vec2 u = vec2_unit_x; vec2 v = {(p1.x-cp.x)/rx, (p1.y-cp.y)/ry}; double sa = acosf (vec2_dot (u, v) / (fabsf(vec2_length(v)) * fabsf(vec2_length(u)))); - if (isnanf(sa)) + if (isnan(sa)) sa=M_PIF; if (u.x*v.y-u.y*v.x < 0) sa = -sa; @@ -1492,7 +1492,7 @@ void _elliptic_arc (VkvgContext ctx, float x1, float y1, float x2, float y2, boo u = v; v = (vec2) {(-p1.x-cp.x)/rx, (-p1.y-cp.y)/ry}; double delta_theta = acosf (vec2_dot (u, v) / (fabsf(vec2_length (v)) * fabsf(vec2_length (u)))); - if (isnanf(delta_theta)) + if (isnan(delta_theta)) delta_theta=M_PIF; if (u.x*v.y-u.y*v.x < 0) delta_theta = -delta_theta;