Skip to content

Commit 6cd2288

Browse files
author
Sebastian Luque
committed
Addressed latest CRAN checks with _STRICT_R_HEADERS (2024-09-23)
Compilation fails with _R_USE_STRICT_R_HEADERS_=true, which defines STRICT_R_HEADERS to 1 which removes - the legacy definition of PI (use POSIX's M_PI, available in R fer ever). - the RS.h declarations for Calloc, Realloc, Free (use R_ forms i available since R 3.4.0). The aim is to clean the namespace: in particular having a definition for Free has conflicted with some packages' C++ code. It is planned that STRICT_R_HEADERS=1 will become the default for 4.5.0, for which it would be good if all CRAN packages compile/install ok with the new default. Your package is among the ones which need updating. We would thus really appreciate if you could provide a new version of your package as soon as possible which checks ok with STRICT_R_HEADERS=1. You can verify that your package checks ok with STRICT_R_HEADERS=1 via R CMD check --as-cran using a current version of R-devel. Please correct before 2024-10-21 to safely retain your package on CRAN. Updated GitHub workflows
1 parent c4eb56e commit 6cd2288

9 files changed

Lines changed: 135 additions & 33 deletions

File tree

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
EXAMPLES.*
77
^TODO$
88
^.AppleDouble$
9+
^.lintr$
910
^vignettes/auto$
1011
^src/\.clang-format$
1112
man-roxygen

.github/workflows/build_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
- name: Setup pandoc
3131
uses: r-lib/actions/setup-pandoc@v2
@@ -63,7 +63,7 @@ jobs:
6363

6464
- name: Upload check results
6565
if: failure()
66-
uses: actions/upload-artifact@v3
66+
uses: actions/upload-artifact@v4
6767
with:
6868
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
6969
path: check

.github/workflows/rhub.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub::rhub_setup()
6+
#
7+
# It is unlikely that you need to modify this file manually.
8+
9+
name: R-hub
10+
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
config:
16+
description: 'A comma separated list of R-hub platforms to use.'
17+
type: string
18+
default: 'linux,windows,macos'
19+
name:
20+
description: 'Run name. You can leave this empty now.'
21+
type: string
22+
id:
23+
description: 'Unique ID. You can leave this empty now.'
24+
type: string
25+
26+
jobs:
27+
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
containers: ${{ steps.rhub-setup.outputs.containers }}
32+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
33+
34+
steps:
35+
# NO NEED TO CHECKOUT HERE
36+
- uses: r-hub/actions/setup@v1
37+
with:
38+
config: ${{ github.event.inputs.config }}
39+
id: rhub-setup
40+
41+
linux-containers:
42+
needs: setup
43+
if: ${{ needs.setup.outputs.containers != '[]' }}
44+
runs-on: ubuntu-latest
45+
name: ${{ matrix.config.label }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
config: ${{ fromJson(needs.setup.outputs.containers) }}
50+
container:
51+
image: ${{ matrix.config.container }}
52+
53+
steps:
54+
- uses: r-hub/actions/checkout@v1
55+
- uses: r-hub/actions/platform-info@v1
56+
with:
57+
token: ${{ secrets.RHUB_TOKEN }}
58+
job-config: ${{ matrix.config.job-config }}
59+
- uses: r-hub/actions/setup-deps@v1
60+
with:
61+
token: ${{ secrets.RHUB_TOKEN }}
62+
job-config: ${{ matrix.config.job-config }}
63+
- uses: r-hub/actions/run-check@v1
64+
with:
65+
token: ${{ secrets.RHUB_TOKEN }}
66+
job-config: ${{ matrix.config.job-config }}
67+
68+
other-platforms:
69+
needs: setup
70+
if: ${{ needs.setup.outputs.platforms != '[]' }}
71+
runs-on: ${{ matrix.config.os }}
72+
name: ${{ matrix.config.label }}
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
77+
78+
steps:
79+
- uses: r-hub/actions/checkout@v1
80+
- uses: r-hub/actions/setup-r@v1
81+
with:
82+
job-config: ${{ matrix.config.job-config }}
83+
token: ${{ secrets.RHUB_TOKEN }}
84+
- uses: r-hub/actions/platform-info@v1
85+
with:
86+
token: ${{ secrets.RHUB_TOKEN }}
87+
job-config: ${{ matrix.config.job-config }}
88+
- uses: r-hub/actions/setup-deps@v1
89+
with:
90+
job-config: ${{ matrix.config.job-config }}
91+
token: ${{ secrets.RHUB_TOKEN }}
92+
- uses: r-hub/actions/run-check@v1
93+
with:
94+
job-config: ${{ matrix.config.job-config }}
95+
token: ${{ secrets.RHUB_TOKEN }}

DESCRIPTION

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
Package: diveMove
22
Type: Package
33
Title: Dive Analysis and Calibration
4-
Version: 1.6.2
5-
Depends: R (>= 3.5.0), methods, stats4
4+
Version: 1.6.4
5+
Depends: R (>= 4.4.0), methods, stats4
66
Suggests: knitr, lattice, pander, rmarkdown, tinytest
77
Imports: geosphere, KernSmooth, plotly, quantreg, uniReg
8-
Author: Sebastian P. Luque <spluque@gmail.com>
8+
Authors@R: person(given = c("Sebastian", "P."),
9+
family = "Luque",
10+
role = c("aut", "cre"),
11+
email = "spluque@gmail.com",
12+
comment = c(ORCID = "0000-0002-9647-3691"))
13+
Author: Sebastian P. Luque [aut, cre] (<https://orcid.org/0000-0002-9647-3691>)
914
Maintainer: Sebastian P. Luque <spluque@gmail.com>
1015
Description: Utilities to represent, visualize, filter, analyse, and summarize
1116
time-depth recorder (TDR) data. Miscellaneous functions for

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Changes in version 1.6.4:
2+
3+
o The package now depends on R >= 4.4.0.
4+
15
Changes in version 1.6.0:
26

37
o Analyses for 2- and 3-process Poisson mixtures are now fully

R/calibrate.R

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,13 @@
242242
##' \code{\link{.detDive}}, \code{\link{plotTDR}}, and
243243
##' \code{\link{plotZOC}} to visually assess ZOC procedure. See
244244
##' \code{\link{diveModel}}, \code{\link{smooth.spline}},
245-
##' \code{\link{unireg}} for dive models.
245+
##' \code{\link[uniReg]{unireg}} for dive models.
246246
##' @references
247247
##'
248-
##' Koellmann, C., Ickstadt, K. and Fried, R. (2014) Beyond unimodal
249-
##' regression: modelling multimodality with piecewise unimodal, mixture or
250-
##' additive regression. Technical Report 8.
251-
##' \url{https://sfb876.tu-dortmund.de/FORSCHUNG/techreports.html}, SFB 876, TU
252-
##' Dortmund
248+
##' Koellmann, C., Ickstadt, K. and Fried, R. (2016) Beyond unimodal
249+
##' regression: modelling multimodality with piecewise unimodal or
250+
##' deconvolution models. Technical Report
251+
##' \url{https://arxiv.org/abs/1606.01666}, Technische Universität Dortmund
253252
##'
254253
##' Luque, S.P. and Fried, R. (2011) Recursive filtering for zero offset
255254
##' correction of diving depth time series. PLoS ONE 6:e15850

man/calibrateDepth.Rd

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/labDive-internal.Rd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
\item{dive.model, smooth.par, knot.factor, descent.crit.q,
3535
ascent.crit.q}{Passed from \code{calibrateDepth}.}
3636

37-
\item{sigmasq, g, ordpen}{default arguments for \code{\link{unireg}}, so
38-
only relevant for \code{divemodel="unimodal"}.}
37+
\item{sigmasq, g, ordpen}{default arguments for
38+
\code{\link[uniReg]{unireg}}, so only relevant for
39+
\code{divemodel="unimodal"}.}
3940

4041
\item{act}{factor with values to label.}
4142

src/run_quantile.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
int R_finite(double x) {
3030
return ((x) == (x));
3131
}
32-
#define Calloc(b, t) (t *) calloc(b, sizeof(t))
33-
#define Free free
3432
#define PRINT(x) \
3533
{ \
3634
if ((x) == (x)) \
@@ -384,10 +382,10 @@ void run_quantile_lite(double *In, double *Out, const int *nIn,
384382
}
385383
} else { /* non-trivial case */
386384
/* index will hold partially sorted index numbers of Save array */
387-
idx = Calloc(m, int);
385+
idx = R_Calloc(m, int);
388386
/* stores all points of the current running window */
389-
Win = Calloc(m, double);
390-
prob = Calloc(nPrb, double);
387+
Win = R_Calloc(m, double);
388+
prob = R_Calloc(nPrb, double);
391389
for (i = 0; i < m; i++) {
392390
Win[i] = *(in++); /* initialize running window */
393391
idx[i] = i; /* and its index */
@@ -417,9 +415,9 @@ void run_quantile_lite(double *In, double *Out, const int *nIn,
417415
j = (j + 1) %
418416
m; /* index goes from 0 to m-1, and back to 0 again */
419417
}
420-
Free(Win);
421-
Free(idx);
422-
Free(prob);
418+
R_Free(Win);
419+
R_Free(idx);
420+
R_Free(prob);
423421
}
424422
}
425423

@@ -447,10 +445,10 @@ void run_quantile(double *In, double *Out, const int *nIn, const int *nWin,
447445
run_max(In, Out, nIn, nWin);
448446
} else { /* non-trivial case */
449447
/* index will hold partially sorted index numbers of Save array */
450-
idx = Calloc(m, int);
448+
idx = R_Calloc(m, int);
451449
/* store all points of the current running window */
452-
Win = Calloc(m, double);
453-
prob = Calloc(nPrb, double);
450+
Win = R_Calloc(m, double);
451+
prob = R_Calloc(nPrb, double);
454452
for (i = 0; i < m; i++) idx[i] = i; /* and its index */
455453
for (i = 0; i < k2; i++) {
456454
Win[i] = *(in++); /* initialize running window */
@@ -558,9 +556,9 @@ void run_quantile(double *In, double *Out, const int *nIn, const int *nWin,
558556
/* index goes from 0 to m-1, and back to 0 again */
559557
j = (j + 1) % m;
560558
}
561-
Free(Win);
562-
Free(idx);
563-
Free(prob);
559+
R_Free(Win);
560+
R_Free(idx);
561+
R_Free(prob);
564562
}
565563
}
566564

0 commit comments

Comments
 (0)