Skip to content

Commit

Permalink
Ensure compilation with STRICT_R_HEADERS (#222)
Browse files Browse the repository at this point in the history
* Ensure compilation with strict r headers

* news
  • Loading branch information
paleolimbot authored Sep 5, 2024
1 parent cd64e4a commit a813a00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/handle-crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ 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));
}

// 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));
Expand Down

0 comments on commit a813a00

Please sign in to comment.