Skip to content

Commit 8c6bb00

Browse files
committed
One of these days I'll catch em all
1 parent 1b3998e commit 8c6bb00

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/fread.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static void parse_double_regular_core(const char **pch, double *target)
770770
// Not a single digit after "E"? Invalid number
771771
return;
772772
}
773-
e += Eneg? -E : E;
773+
e += Eneg ? -E : E;
774774
}
775775
if (e < -350 || e > 350) return;
776776

@@ -1418,7 +1418,7 @@ int freadMain(freadMainArgs _args) {
14181418
// Mac doesn't appear to support MAP_POPULATE anyway (failed on CRAN when I tried).
14191419
// TO DO?: MAP_HUGETLB for Linux but seems to need admin to setup first. My Hugepagesize is 2MB (>>2KB, so promising)
14201420
// https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt
1421-
mmp = mmap(NULL, fileSize, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); // COW for last page lastEOLreplaced
1421+
mmp = mmap(NULL, fileSize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); // COW for last page lastEOLreplaced
14221422
#ifdef __EMSCRIPTEN__
14231423
mmp_fd = fd;
14241424
#else
@@ -1447,11 +1447,11 @@ int freadMain(freadMainArgs _args) {
14471447
STOP(_("File size [%s] exceeds the address space: %s"), filesize_to_str(liFileSize.QuadPart), fnam); // # nocov
14481448
}
14491449
fileSize = (size_t)liFileSize.QuadPart;
1450-
if (fileSize==0) { CloseHandle(hFile); STOP(_("File is empty: %s"), fnam); }
1450+
if (fileSize == 0) { CloseHandle(hFile); STOP(_("File is empty: %s"), fnam); }
14511451
if (verbose) DTPRINT(_(" File opened, size = %s.\n"), filesize_to_str(fileSize));
14521452
HANDLE hMap = CreateFileMapping(hFile, NULL, PAGE_WRITECOPY, 0, 0, NULL);
14531453
if (hMap == NULL) { CloseHandle(hFile); STOP(_("This is Windows, CreateFileMapping returned error %lu for file %s"), GetLastError(), fnam); }
1454-
mmp = MapViewOfFile(hMap,FILE_MAP_COPY,0,0,fileSize); // fileSize must be <= hilo passed to CreateFileMapping above.
1454+
mmp = MapViewOfFile(hMap, FILE_MAP_COPY, 0, 0, fileSize); // fileSize must be <= hilo passed to CreateFileMapping above.
14551455
CloseHandle(hMap); // we don't need to keep the file open; the MapView keeps an internal reference;
14561456
CloseHandle(hFile); // see https://msdn.microsoft.com/en-us/library/windows/desktop/aa366537(v=vs.85).aspx
14571457
if (mmp == NULL) {
@@ -1500,7 +1500,7 @@ int freadMain(freadMainArgs _args) {
15001500
if (verbose) DTPRINT(_(" Last byte(s) of input found to be %s and removed.\n"),
15011501
c ? "0x1A (Ctrl+Z)" : "0x00 (NUL)");
15021502
}
1503-
if (eof<=sof) STOP(_("Input is empty or only contains BOM or terminal control characters"));
1503+
if (eof <= sof) STOP(_("Input is empty or only contains BOM or terminal control characters"));
15041504
}
15051505

15061506
//*********************************************************************************************
@@ -2270,7 +2270,7 @@ int freadMain(freadMainArgs _args) {
22702270
chunkBytes = bytesRead / nJumps;
22712271
} else {
22722272
ASSERT(nJumps == 1 /*when nrowLimit supplied*/ || nJumps == 2 /*small files*/, "nJumps (%d) != 1|2", nJumps);
2273-
nJumps=1;
2273+
nJumps = 1;
22742274
}
22752275
int64_t initialBuffRows = allocnrow / nJumps;
22762276

@@ -2421,7 +2421,7 @@ int freadMain(freadMainArgs _args) {
24212421
if (eol(&tch) && skipEmptyLines) { tch++; continue; }
24222422
tch = tLineStart; // in case white space at the beginning may need to be including in field
24232423
}
2424-
else if (eol(&tch) && j<ncol) { // j<ncol needed for #2523 (erroneous extra comma after last field)
2424+
else if (eol(&tch) && j < ncol) { // j<ncol needed for #2523 (erroneous extra comma after last field)
24252425
int8_t thisSize = size[j];
24262426
if (thisSize) ((char **) targets)[thisSize] += thisSize;
24272427
j++;

0 commit comments

Comments
 (0)