From a813a00424319837ae6484481932bb2077e7d767 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Thu, 5 Sep 2024 14:55:01 -0500 Subject: [PATCH] Ensure compilation with STRICT_R_HEADERS (#222) * Ensure compilation with strict r headers * news --- NEWS.md | 2 ++ src/handle-crc.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index c4b4d64f..e6959b87 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # wk (development version) +- Ensure package compiles with `STRICT_R_HEADERS=1` (#222). + # wk 0.9.2 - Add `wk_crs()` and `wk_set_crs()` methods for `bbox` (#213) diff --git a/src/handle-crc.c b/src/handle-crc.c index 325d25c0..b0a45bf9 100644 --- a/src/handle-crc.c +++ b/src/handle-crc.c @@ -27,7 +27,7 @@ int wk_crc_handle_single(wk_handler_t* handler, const wk_meta_t* meta, double x, double angle; for (int i = 0; i < segs_per_circle; i++) { - angle = i / segs_per_circle * PI * 2.0; + angle = i / segs_per_circle * M_PI * 2.0; coord[0] = x + r * cos(angle); coord[1] = y + r * sin(angle); HANDLE_OR_RETURN(handler->coord(meta, coord, i, handler->handler_data)); @@ -35,7 +35,7 @@ int wk_crc_handle_single(wk_handler_t* handler, const wk_meta_t* meta, double x, // re-export the first coordinate (i = 0) identically // to ensure that the loops are closed with no floating-point error - angle = 0 / segs_per_circle * PI * 2.0; + angle = 0 / segs_per_circle * M_PI * 2.0; coord[0] = x + r * cos(angle); coord[1] = y + r * sin(angle); HANDLE_OR_RETURN(handler->coord(meta, coord, segs_per_circle, handler->handler_data));