Skip to content

Commit 92d74df

Browse files
Use %ld, not %td (#6978)
* Use %ld, not %td * remove comment * Add %td check to CRAN_Release * just remove (unenforced) provision for very old R
1 parent 01a65d2 commit 92d74df

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

.dev/CRAN_Release.cmd

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,6 @@ grep "PROTECT_PTR" ./src/*.c
9595
# No use of long long, instead use int64_t. TODO
9696
# grep "long long" ./src/*.c
9797

98-
// No use of llu, lld, zd or zu
99-
grep -nE "(llu|lld|zd|zu)" src/*.[hc]
100-
// Comment moved here from fread.c on 19 Nov 2019
101-
// [Moved from fread.c on 19 Nov 2019] On Windows variables of type `size_t` cannot be printed
102-
// with "%zu" in the `snprintf()` function. For those variables we used to cast them into
103-
// `unsigned long long int` before printing, and defined (llu) to make the cast shorter.
104-
// We're now observing warnings from gcc-8 with -Wformat-extra-args, #4062. So
105-
// now we're more strict and cast to [u]int64_t and use PRIu64/PRId64 from <inttypes.h>
106-
// In many cases the format specifier is passed to our own macro (e.g. DTPRINT) or to Rprintf(),
107-
// error() etc, and even if they don't call sprintf() now, they could in future.
108-
10998
# No tabs in C or R code (sorry, Richard Hendricks)
11099
grep -P "\t" ./R/*.R
111100
grep -P "\t" ./src/*.c

src/fread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,8 +1919,8 @@ int freadMain(freadMainArgs _args) {
19191919
} else if (jump0size==0) {
19201920
DTPRINT(_(" Number of sampling jump points = %d because jump0size==0\n"), nJumps);
19211921
} else {
1922-
DTPRINT(_(" Number of sampling jump points = %d because (%td bytes from row 1 to eof) / (2 * %td jump0size) == %td\n"),
1923-
nJumps, sz, jump0size, sz/(2*jump0size));
1922+
DTPRINT(_(" Number of sampling jump points = %d because (%ld bytes from row 1 to eof) / (2 * %ld jump0size) == %ld\n"),
1923+
nJumps, (long int)sz, (long int)jump0size, (long int)(sz/(2*jump0size)));
19241924
}
19251925
}
19261926
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)