Skip to content

Commit b002ad7

Browse files
committed
Merge branch 'master' of https://github.com/badasahog/data.table
2 parents 6037469 + 75a651d commit b002ad7

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/fread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static inline void skip_white(const char **pch) {
237237
// skip space so long as sep isn't space and skip tab so long as sep isn't tab
238238
// always skip any \0 (NUL) that occur before end of file, #3400
239239
const char *ch = *pch;
240-
if (whiteChar==0) { // whiteChar==0 means skip both ' ' and '\t'; sep is neither ' ' nor '\t'.
240+
if (whiteChar=='\0') { // whiteChar==0 means skip both ' ' and '\t'; sep is neither ' ' nor '\t'.
241241
while (*ch==' ' || *ch=='\t' || (*ch=='\0' && ch<eof)) ch++;
242242
} else {
243243
while (*ch==whiteChar || (*ch=='\0' && ch<eof)) ch++; // sep is ' ' or '\t' so just skip the other one.
@@ -1673,7 +1673,7 @@ int freadMain(freadMainArgs _args) {
16731673
// unusual
16741674
if (verbose) DTPRINT(_(" sep='\\n' passed in meaning read lines as single character column\n"));
16751675
sep = 127; // ASCII DEL: a character different from \r, \n and \0 that isn't in the data
1676-
whiteChar = 0;
1676+
whiteChar = '\0';
16771677
quoteRule = 3; // Ignore quoting
16781678
ncol = 1;
16791679
int thisLine=0;

src/fsort.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ static void dinsert(double *x, const int n) { // TODO: if and when twiddled, d
1818

1919
static uint64_t minULL;
2020

21-
static void dradix_r( // single-threaded recursive worker
22-
double *in, // n doubles to be sorted
23-
double *working, // working memory to put the sorted items before copying over *in; must not overlap *in
24-
uint64_t n, // number of items to sort. *in and *working must be at least n long
25-
int fromBit, // After twiddle to ordered ull, the bits [fromBit,toBit] are used to count
26-
int toBit, // fromBit<toBit; bit 0 is the least significant; fromBit is right shift amount too
27-
uint64_t *counts // already zero'd counts vector, 2^(toBit-fromBit+1) long. A stack of these is reused.
21+
static void dradix_r( // single-threaded recursive worker
22+
double * restrict in, // n doubles to be sorted
23+
double * restrict working, // working memory to put the sorted items before copying over *in; must not overlap *in
24+
uint64_t n, // number of items to sort. *in and *working must be at least n long
25+
int fromBit, // After twiddle to ordered ull, the bits [fromBit,toBit] are used to count
26+
int toBit, // fromBit<toBit; bit 0 is the least significant; fromBit is right shift amount too
27+
uint64_t * restrict counts // already zero'd counts vector, 2^(toBit-fromBit+1) long. A stack of these is reused.
2828
) {
2929
uint64_t width = 1ULL<<(toBit-fromBit+1);
3030
uint64_t mask = width-1;

src/fwriteR.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,15 @@ static int32_t whichWriter(SEXP);
7575

7676
void writeList(const void *col, int64_t row, char **pch) {
7777
SEXP v = ((const SEXP *)col)[row];
78-
int32_t wf = whichWriter(v);
78+
const int32_t wf = whichWriter(v);
7979
if (TYPEOF(v)==VECSXP || wf==INT32_MIN || isFactor(v)) {
8080
internal_error(__func__, "TYPEOF(v)!=VECSXP && wf!=INT32_MIN && !isFactor(v); getMaxListItem should have caught this up front"); // # nocov
8181
}
8282
char *ch = *pch;
8383
write_chars(sep2start, &ch);
8484
const void *data = DATAPTR_RO(v);
85-
writer_fun_t *fun = funs[wf];
8685
for (int j=0; j<LENGTH(v); j++) {
87-
(*fun)(data, j, &ch);
86+
funs[wf](data, j, &ch);
8887
*ch++ = sep2;
8988
}
9089
if (LENGTH(v)) ch--; // backup over the last sep2 after the last item

0 commit comments

Comments
 (0)