|
10 | 10 | #include <R.h>
|
11 | 11 | #include <Rdefines.h>
|
12 | 12 | #include <Rinternals.h>
|
| 13 | +#include <R_ext/Arith.h> |
| 14 | +#include <R_ext/Error.h> |
| 15 | +#include <R_ext/RS.h> |
| 16 | +#include <stdlib.h> |
13 | 17 |
|
14 | 18 | #include "merge.h"
|
15 | 19 | #include "sort.h"
|
@@ -39,9 +43,9 @@ static bitint *mask0, *mask1;
|
39 | 43 |
|
40 | 44 | static void bit_init(int bits){
|
41 | 45 | if (bits != BITS)
|
42 |
| - error("R .BITS and C BITS are not in sync"); |
| 46 | + Rf_error("R .BITS and C BITS are not in sync"); // # nocov |
43 | 47 | if (bits-1 != LASTBIT)
|
44 |
| - error("R .BITS and C LASTBIT are not in sync"); |
| 48 | + Rf_error("R .BITS and C LASTBIT are not in sync"); // # nocov |
45 | 49 | mask0 = calloc(BITS, sizeof(bitint));
|
46 | 50 | mask1 = calloc(BITS, sizeof(bitint));
|
47 | 51 | bitint b = 1;
|
@@ -677,8 +681,6 @@ static void bit_replace_but_sorted(bitint *b, int nb, int *i, int ni, int *l){
|
677 | 681 | b[j] |= mask1[k];
|
678 | 682 | il++;
|
679 | 683 | }
|
680 |
| - |
681 |
| - return; |
682 | 684 | }
|
683 | 685 |
|
684 | 686 |
|
@@ -767,8 +769,6 @@ static void bit_replace_but_sorted_recycle(bitint *b, int nb, int *i, int ni, in
|
767 | 769 | if (++il>=nl)
|
768 | 770 | il -= nl; // recycle l
|
769 | 771 | }
|
770 |
| - |
771 |
| - return; |
772 | 772 | }
|
773 | 773 |
|
774 | 774 |
|
@@ -841,8 +841,6 @@ static void bit_replace_but_sorted_one(bitint *b, int nb, int *i, int ni, int l)
|
841 | 841 | else
|
842 | 842 | b[j] |= mask1[k];
|
843 | 843 | }
|
844 |
| - |
845 |
| - return; |
846 | 844 | }
|
847 | 845 |
|
848 | 846 |
|
@@ -2191,7 +2189,7 @@ SEXP R_bit_reverse(
|
2191 | 2189 | int nt = asInteger(tleng);
|
2192 | 2190 | UNPROTECT(6);
|
2193 | 2191 | if (ns!= nt)
|
2194 |
| - error("source and target must have same length in R_bit_reverse"); |
| 2192 | + Rf_error("source and target must have same length in R_bit_reverse"); |
2195 | 2193 | bit_reverse(bsource, btarget, ns);
|
2196 | 2194 | return(btarget_);
|
2197 | 2195 | }
|
|
0 commit comments