Skip to content

Commit 073cf31

Browse files
committed
boolean not bitwise
1 parent d469581 commit 073cf31

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/checks.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# include <Rinternals.h>
33

44
void check_size(SEXP size) {
5-
if ((INTEGER(size)[0] == R_NaInt) | (INTEGER(size)[0] < 1)) {
5+
if ((INTEGER(size)[0] == R_NaInt) || (INTEGER(size)[0] < 1)) {
66
Rf_error("%s", "bad dimension ncol or nrow is < 1 or missing");
77
}
88
}
99
void check_range(SEXP range) {
1010
double c_max = REAL(range)[1];
1111
double c_min = REAL(range)[0];
12-
if (!R_finite(c_max) | !R_finite(c_min) | (c_max <= c_min)) {
12+
if (!R_finite(c_max) || !R_finite(c_min) || (c_max <= c_min)) {
1313
Rf_error("%s", "bad extent, xmax <= xmin, ymax <= ymin, or missing values");
1414
}
1515
}
@@ -23,10 +23,10 @@ void check_extent(SEXP extent) {
2323
double y_min = REAL(extent)[2];
2424
double x_max = REAL(extent)[1];
2525
double x_min = REAL(extent)[0];
26-
if (!R_finite(x_max) | !R_finite(x_min) | (x_max <= x_min)) {
26+
if (!R_finite(x_max) || !R_finite(x_min) || (x_max <= x_min)) {
2727
Rf_error("%s", "bad extent, xmax <= xmin or missing values");
2828
}
29-
if (!R_finite(y_max) | !R_finite(y_min) | (y_max <= y_min)) {
29+
if (!R_finite(y_max) || !R_finite(y_min) || (y_max <= y_min)) {
3030
Rf_error("%s", "bad extent, ymax <= ymin or missing values");
3131
}
3232
}

src/coordinates.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SEXP bin_from_float(SEXP bins, SEXP range, SEXP coord) {
1717
for (int i = 0; i < nn; i++) {
1818
if (rcoord[i] == cmax) {
1919
rout[i] = rbin - 1;
20-
} else if ((rcoord[i] > cmax) | (rcoord[i] < cmin)) {
20+
} else if ((rcoord[i] > cmax) || (rcoord[i] < cmin)) {
2121
rout[i] = R_NaReal;
2222
} else {
2323
rout[i] = trunc((cmax - rcoord[i])/scl);

0 commit comments

Comments
 (0)