Skip to content

Commit 0032a4a

Browse files
committed
implemented suggested fixes
1 parent 40a9ded commit 0032a4a

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
@@ -197,14 +197,14 @@ static inline int64_t clamp_szt(int64_t x, int64_t lower, int64_t upper) {
197197
* is constructed manually (using say snprintf) that warning(), stop()
198198
* and Rprintf() are all called as warning(_("%s"), msg) and not warning(msg).
199199
*/
200-
static const char* strlim(const char *ch, int64_t limit) {
200+
static const char* strlim(const char *ch, size_t limit) {
201201
static char buf[1002];
202202
static int flip = 0;
203203
char *ptr = buf + 501 * flip;
204204
flip = 1 - flip;
205205
char *ch2 = ptr;
206206
limit = imin(limit, 500);
207-
int64_t width = 0;
207+
size_t width = 0;
208208
while ((*ch>'\r' || (*ch!='\0' && *ch!='\r' && *ch!='\n')) && width++<limit) {
209209
*ch2++ = *ch++;
210210
}
@@ -2252,7 +2252,7 @@ int freadMain(freadMainArgs _args) {
22522252
// For the 44GB file with 12875 columns, the max line len is 108,497. We may want each chunk to write to its
22532253
// own page (4k) of the final column, hence 1000 rows of the smallest type (4 byte int) is just
22542254
// under 4096 to leave space for R's header + malloc's header.
2255-
int64_t chunkBytes = umax((uint64_t)(1000*meanLineLen), 1ULL/*MB*/ *1024*1024);
2255+
size_t chunkBytes = umax((size_t)(1000*meanLineLen), 1ULL/*MB*/ *1024*1024);
22562256
// Index of the first jump to read. May be modified if we ever need to restart
22572257
// reading from the middle of the file.
22582258
int jump0 = 0;

0 commit comments

Comments
 (0)