Skip to content

Commit 9c882b4

Browse files
committed
changed readInt64As to an argument instead of extern object
1 parent 6090c9e commit 9c882b4

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/fread.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#include <stdbool.h>
2727
#include "freadLookups.h"
2828

29-
extern colType readInt64As;
30-
3129
// Private globals to save passing all of them through to highly iterated field processors
3230
static const char *sof, *eof;
3331
static char sep;
@@ -2513,8 +2511,8 @@ int freadMain(freadMainArgs _args) {
25132511
// sure a single re-read will definitely work.
25142512
while (++absType<CT_STRING && disabled_parsers[absType]) {};
25152513

2516-
if(readInt64As != CT_INT64 && absType == CT_INT64)
2517-
thisType = TOGGLE_BUMP(readInt64As);
2514+
if(args.readInt64As != CT_INT64 && absType == CT_INT64)
2515+
thisType = TOGGLE_BUMP(args.readInt64As);
25182516
else
25192517
thisType = TOGGLE_BUMP(absType);
25202518

src/fread.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ typedef struct freadMainArgs
167167
// should datetime with no Z or UTZ-offset be read as UTC?
168168
bool noTZasUTC;
169169

170+
// Integer64 remap
171+
colType readInt64As;
172+
170173
char _padding[1];
171174

172175
// Any additional implementation-specific parameters.

src/freadR.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ SEXP freadR(
177177
readInt64As = CT_FLOAT64;
178178
} else STOP(_("Invalid value integer64='%s'. Must be 'integer64', 'character', 'double' or 'numeric'"), tt);
179179

180+
args.readInt64As = readInt64As;
181+
180182
colClassesSxp = colClassesArg;
181183

182184
selectSxp = selectArg;

0 commit comments

Comments
 (0)