Skip to content

Commit

Permalink
Merge pull request #129 from rformassspectrometry/strict-r-headers
Browse files Browse the repository at this point in the history
fix: use R_Calloc/R_Free instead of Calloc/Free to reflect changes in R API
  • Loading branch information
jorainer authored Oct 21, 2024
2 parents 4981e56 + dad8765 commit d601c84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MsCoreUtils
Title: Core Utils for Mass Spectrometry Data
Version: 1.17.2
Version: 1.17.3
Description: MsCoreUtils defines low-level functions for mass
spectrometry data and is independent of any high-level data
structures. These functions include mass spectra processing
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# MsCoreUtils 1.17

## MsCoreUtils 1.17.3

- Use `R_Calloc` and `R_Free` instead of `Calloc` and `Free` in
`src/lowerConvexHull.c`, respectively, to reflect changes in the R API and
fullfil STRICT_R_HEADERS check.

## MsCoreUtils 1.17.2

- Fix typo in normalisation methods description.
Expand Down
4 changes: 2 additions & 2 deletions src/lowerConvexHull.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SEXP C_lowerConvexHull(SEXP x, SEXP y) {
PROTECT(output=allocVector(REALSXP, n));
/* TODO: replace by R_xlen_t in R 3.0.0 */
/* allocate vector - error handling is done by R */
nodes=(int*) Calloc((size_t) n, int);
nodes=(int*) R_Calloc((size_t) n, int);

double* xx=REAL(x);
double* xy=REAL(y);
Expand Down Expand Up @@ -71,7 +71,7 @@ SEXP C_lowerConvexHull(SEXP x, SEXP y) {

xo[n-1]=xy[n-1];

Free(nodes);
R_Free(nodes);
UNPROTECT(3);

return(output);
Expand Down

0 comments on commit d601c84

Please sign in to comment.