You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (; i<ncol; i++) str[i] =typeLetter[abs(type[i])]; // abs for out-of-sample type bumps (negative)
226
+
for (; i<ncol; i++) str[i] =typeLetter[GET_UNBUMPED(type[i])]; // abs for out-of-sample type bumps (negative)
224
227
} else {
225
-
for (; i<80; i++) str[i] =typeLetter[abs(type[i])];
228
+
for (; i<80; i++) str[i] =typeLetter[GET_UNBUMPED(type[i])];
226
229
str[i++]='.'; str[i++]='.'; str[i++]='.';
227
-
for (intj=ncol-10; j<ncol; j++) str[i++] =typeLetter[abs(type[j])];
230
+
for (intj=ncol-10; j<ncol; j++) str[i++] =typeLetter[GET_UNBUMPED(type[j])];
228
231
}
229
232
str[i] ='\0';
230
233
returnstr;
@@ -2405,7 +2408,7 @@ int freadMain(freadMainArgs _args) {
2405
2408
// DTPRINT(_("Field %d: '%.10s' as type %d (tch=%p)\n"), j+1, tch, type[j], tch);
2406
2409
fieldStart=tch;
2407
2410
int8_tthisType=type[j]; // fetch shared type once. Cannot read half-written byte is one reason type's type is single byte to avoid atomic read here.
2408
-
fun[abs(thisType)](&fctx);
2411
+
fun[GET_UNBUMPED(thisType)](&fctx);
2409
2412
if (*tch!=sep) break;
2410
2413
int8_tthisSize=size[j];
2411
2414
if (thisSize) ((char**) targets)[thisSize] +=thisSize; // 'if' for when rereading to avoid undefined NULL+0
@@ -2455,7 +2458,7 @@ int freadMain(freadMainArgs _args) {
2455
2458
fieldStart=tch;
2456
2459
int8_tjoldType=type[j];
2457
2460
int8_tthisType=joldType; // to know if it was bumped in (rare) out-of-sample type exceptions
2458
-
int8_tabsType= (int8_t)abs(thisType);
2461
+
int8_tabsType= (int8_t)GET_UNBUMPED(thisType);
2459
2462
2460
2463
while (absType<NUMTYPE) {
2461
2464
tch=fieldStart;
@@ -2468,7 +2471,7 @@ int freadMain(freadMainArgs _args) {
2468
2471
if (!end_of_field(tch)) tch=afterSpace; // else it is the field_end, we're on closing sep|eol and we'll let processor write appropriate NA as if field was empty
2469
2472
if (*tch==quote&"e) { quoted=true; tch++; }
2470
2473
} // else Field() handles NA inside it unlike other processors e.g. ,, is interpreted as "" or NA depending on option read inside Field()
2471
-
fun[abs(thisType)](&fctx);
2474
+
fun[GET_UNBUMPED(thisType)](&fctx);
2472
2475
if (quoted) { // quoted was only set to true with '&& quote' above (=> quote!='\0' now)
2473
2476
if (*tch==quote) tch++;
2474
2477
else goto typebump;
@@ -2487,7 +2490,7 @@ int freadMain(freadMainArgs _args) {
2487
2490
// sure a single re-read will definitely work.
2488
2491
typebump:
2489
2492
while (++absType<CT_STRING&&disabled_parsers[absType]) {};
2490
-
thisType=-absType;
2493
+
thisType=MAKE_BUMPED(absType);
2491
2494
tch=fieldStart;
2492
2495
}
2493
2496
@@ -2499,7 +2502,7 @@ int freadMain(freadMainArgs _args) {
2499
2502
if (j+fieldsRemaining!=ncol) break;
2500
2503
checkedNumberOfFields= true;
2501
2504
}
2502
-
if (thisType <= -NUMTYPE) {
2505
+
if (thisType <= MAKE_BUMPED(NUMTYPE)) {
2503
2506
break; // Improperly quoted char field needs to be healed below, other columns will be filled #5041 and #4774
2504
2507
}
2505
2508
#pragma omp critical
@@ -2512,7 +2515,7 @@ int freadMain(freadMainArgs _args) {
2512
2515
intlen=snprintf(temp, 1000,
2513
2516
_("Column %d%s%.*s%s bumped from '%s' to '%s' due to <<%.*s>> on row %"PRIu64"\n"),
0 commit comments