Skip to content

Commit

Permalink
Small Correction
Browse files Browse the repository at this point in the history
  • Loading branch information
2005m committed Jun 26, 2024
1 parent 1a0bf42 commit 1a6310a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion MD5
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ b929f70ab892f155eeead08c160ffc25 *src/kit.h
a52426250b954a335b1121948e057ee7 *src/Makevars.in
95e3011e37d9dde0d75f3a3819b2acd3 *src/Makevars.win
1e8b11cf04b116653c0a82a20f72490b *src/nswitch.c
7b6cc295ee89e397e47957097cf15417 *src/psort.c
0bb2655499d4ac66b45be687d6fae6e9 *src/psort.c
8c15e9c171d447aed088cec849323fab *src/psum.c
7589054d8388fe7ed3354a5aa388eb02 *src/share.c
ef9329d7e748c13b9526fca1788a1891 *src/topn.c
Expand Down
16 changes: 8 additions & 8 deletions src/psort.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
static int K = 8;
static size_t M = 256;

static void recursiveRadix(SEXP *restrict pans, const size_t k, size_t *restrict pos,
static void recursiveRadix(const SEXP *restrict pans, const size_t k, size_t *restrict pos,
size_t *restrict incr, uint8_t *restrict test, SEXP tmp,
SEXP *restrict ptmp, size_t start, size_t *restrict newpos) {
const SEXP *restrict ptmp, size_t start, size_t *restrict newpos) {
for (uint16_t i = 1; i < 257; ++i){
if (pos[i] == 1) {
start++; continue;
}
if (pos[i] > 1) {
const size_t ct = pos[i];
SEXP *npans = pans + start;
SEXP *npans = (SEXP*)pans + start;
memset(incr, 0, 257*sizeof(size_t));
for(size_t j = 0; j < ct; ++j) {
test[j] = (uint8_t)(CHAR(npans[j])[k]);
Expand Down Expand Up @@ -74,16 +74,16 @@ static void recursiveRadix(SEXP *restrict pans, const size_t k, size_t *restrict
}
}

static void recursiveRadixrev(SEXP *restrict pans, const size_t k, size_t *restrict pos,
static void recursiveRadixrev(const SEXP *restrict pans, const size_t k, size_t *restrict pos,
size_t *restrict incr, uint8_t *restrict test, SEXP tmp,
SEXP *restrict ptmp, size_t start, size_t *restrict newpos) {
const SEXP *restrict ptmp, size_t start, size_t *restrict newpos) {
for (uint16_t i = 256; i > 0; --i){
if (pos[i] == 1) {
start++; continue;
}
if (pos[i] > 1) {
const size_t ct = pos[i];
SEXP *npans = pans + start;
SEXP *npans = (SEXP*)pans + start;
memset(incr, 0, 257*sizeof(size_t));
for(size_t j = 0; j < ct; ++j) {
test[j] = (uint8_t)(CHAR(npans[j])[k]);
Expand Down Expand Up @@ -404,7 +404,7 @@ SEXP cpsortR (SEXP x, SEXP decreasing, SEXP nthread, SEXP nalast, SEXP env, SEXP
return valSorted;
}*/

SEXP *restrict pvalSorted = STRING_PTR_RO(valSorted);
SEXP *restrict pvalSorted = (SEXP*)STRING_PTR_RO(valSorted);
const int nlen = LENGTH(valSorted);

int NAidx = -1;
Expand Down Expand Up @@ -570,7 +570,7 @@ SEXP charToFactR (SEXP x, SEXP decreasing, SEXP nthread, SEXP nalast, SEXP env,
SEXP uVals = PROTECT(dupVecSort(x));
const int n = LENGTH(uVals);
SEXP valSorted = PROTECT(callToSort2(uVals, "quick", dcr, 1, env));
SEXP *restrict pvalSorted = STRING_PTR_RO(valSorted);
SEXP *restrict pvalSorted = (SEXP*)STRING_PTR_RO(valSorted);

int NAidx = -1;
for (int i = 0; i < n; ++i) {
Expand Down

0 comments on commit 1a6310a

Please sign in to comment.