Skip to content

Commit 8c253bc

Browse files
committed
type change from size_t to ptrdiff_t
1 parent 599f9a4 commit 8c253bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fread.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,12 +1900,12 @@ int freadMain(freadMainArgs _args) {
19001900
tmpType[j] = type[j] = type0;
19011901
}
19021902

1903-
size_t jump0size=(size_t)(firstJumpEnd-pos); // the size in bytes of the first 100 lines from the start (jump point 0)
1903+
const ptrdiff_t jump0size = firstJumpEnd - pos; // the size in bytes of the first 100 lines from the start (jump point 0)
19041904
// how many places in the file to jump to and test types there (the very end is added as 11th or 101th)
19051905
// not too many though so as not to slow down wide files; e.g. 10,000 columns. But for such large files (50GB) it is
19061906
// worth spending a few extra seconds sampling 10,000 rows to decrease a chance of costly reread even further.
19071907
nJumps = 1;
1908-
size_t sz = (size_t)(eof - pos);
1908+
const ptrdiff_t sz = eof - pos;
19091909
if (jump0size>0) {
19101910
if (jump0size*100*2 < sz) nJumps=100; // 100 jumps * 100 lines = 10,000 line sample
19111911
else if (jump0size*10*2 < sz) nJumps=10;
@@ -1918,7 +1918,7 @@ int freadMain(freadMainArgs _args) {
19181918
DTPRINT(_(" Number of sampling jump points = %d because jump0size==0\n"), nJumps);
19191919
} else {
19201920
DTPRINT(_(" Number of sampling jump points = %d because (%"PRIu64" bytes from row 1 to eof) / (2 * %"PRIu64" jump0size) == %"PRIu64"\n"),
1921-
nJumps, (uint64_t)sz, (uint64_t)jump0size, (uint64_t)(sz/(2*jump0size)));
1921+
nJumps, sz, jump0size, sz/(2*jump0size));
19221922
}
19231923
}
19241924
nJumps++; // the extra sample at the very end (up to eof) is sampled and format checked but not jumped to when reading

0 commit comments

Comments
 (0)