Skip to content

Commit 56a4224

Browse files
committed
fix: add additional C++ fixes
1 parent c41bd1d commit 56a4224

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ root = true
66
charset = utf-8
77
end_of_line = lf
88
trim_trailing_whitespace = true
9-
insert_final_newline = false
9+
insert_final_newline = true
1010

1111
[*.R]
1212
indent_style = space
@@ -18,4 +18,4 @@ indent_style = tab
1818

1919
[.travis.yml]
2020
indent_style = space
21-
indent_size = 2
21+
indent_size = 2

.github/workflows/check-bioc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ jobs:
5454
matrix:
5555
config:
5656
- { os: ubuntu-latest, r: 'devel', bioc: 'devel', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
57-
- { os: macOS-latest, r: '4.4', bioc: 'devel'}
58-
- { os: windows-latest, r: '4.4', bioc: 'devel'}
57+
- { os: macOS-latest, r: '4.4', bioc: '3.20'}
58+
- { os: windows-latest, r: '4.4', bioc: '3.20'}
5959
env:
6060
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
6161
RSPM: ${{ matrix.config.rspm }}

src/massifquant/nmath.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ double gamma_cody(double);
4747

4848
#include <R_ext/Error.h>
4949
# define MATHLIB_ERROR(fmt,x) Rf_error(fmt,x);
50-
# define MATHLIB_WARNING(fmt,x) warning(fmt,x)
51-
# define MATHLIB_WARNING2(fmt,x,x2) warning(fmt,x,x2)
52-
# define MATHLIB_WARNING3(fmt,x,x2,x3) warning(fmt,x,x2,x3)
53-
# define MATHLIB_WARNING4(fmt,x,x2,x3,x4) warning(fmt,x,x2,x3,x4)
50+
# define MATHLIB_WARNING(fmt,x) Rf_warning(fmt,x)
51+
# define MATHLIB_WARNING2(fmt,x,x2) Rf_warning(fmt,x,x2)
52+
# define MATHLIB_WARNING3(fmt,x,x2,x3) Rf_warning(fmt,x,x2,x3)
53+
# define MATHLIB_WARNING4(fmt,x,x2,x3,x4) Rf_warning(fmt,x,x2,x3,x4)
5454

5555
#include <R_ext/Arith.h>
5656
#define ML_POSINF R_PosInf
@@ -199,4 +199,4 @@ void attribute_hidden bratio(double a, double b, double x, double y,
199199
double *w, double *w1, int *ierr, int log_p);
200200

201201

202-
#endif /* MATHLIB_PRIVATE_H */
202+
#endif /* MATHLIB_PRIVATE_H */

src/xcms_obiwarp.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ extern "C" SEXP R_set_from_xcms(SEXP valscantime, SEXP scantime, SEXP mzrange, S
3939
double *pscantime2, *pmz2, *pintensity2;
4040
SEXP corrected;
4141

42-
PROTECT(valscantime = coerceVector(valscantime, INTSXP));
43-
mzrange = coerceVector(mzrange, INTSXP);
42+
PROTECT(valscantime = Rf_coerceVector(valscantime, INTSXP));
43+
mzrange = Rf_coerceVector(mzrange, INTSXP);
4444
pvalscantime = INTEGER(valscantime)[0];
4545
pmzrange = INTEGER(mzrange)[0];
4646
pscantime = REAL(scantime);
4747
pmz = REAL(mz);
4848
pintensity = REAL(intensity);
4949

50-
PROTECT(valscantime2 = coerceVector(valscantime2, INTSXP));
51-
mzrange2 = coerceVector(mzrange2, INTSXP);
50+
PROTECT(valscantime2 = Rf_coerceVector(valscantime2, INTSXP));
51+
mzrange2 = Rf_coerceVector(mzrange2, INTSXP);
5252
pvalscantime2 = INTEGER(valscantime2)[0];
5353
pmzrange2 = INTEGER(mzrange2)[0];
5454
pscantime2 = REAL(scantime2);
@@ -120,13 +120,13 @@ extern "C" SEXP R_set_from_xcms(SEXP valscantime, SEXP scantime, SEXP mzrange, S
120120
lmat2.tm_axis_vals(nOut, nOutF);
121121
lmat2.warp_tm(nOutF, mOutF);
122122

123-
PROTECT(corrected = allocVector(REALSXP, length(scantime2)));
124-
for(int i=0; i < length(scantime2);i++){
123+
PROTECT(corrected = Rf_allocVector(REALSXP, Rf_length(scantime2)));
124+
for(int i=0; i < Rf_length(scantime2);i++){
125125
REAL(corrected)[i] = lmat2.tm()->back()[i];
126126
}
127127

128128
UNPROTECT(3);
129129

130130
return corrected;
131131

132-
}
132+
}

0 commit comments

Comments
 (0)