Skip to content

Commit 41152fd

Browse files
authored
One of these days I'll catch em all (#7112)
1 parent d42ff16 commit 41152fd

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
@@ -774,7 +774,7 @@ static void parse_double_regular_core(const char **pch, double *target)
774774
// Not a single digit after "E"? Invalid number
775775
return;
776776
}
777-
e += Eneg? -E : E;
777+
e += Eneg ? -E : E;
778778
}
779779
if (e < -350 || e > 350) return;
780780

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

15101510
//*********************************************************************************************
@@ -2274,7 +2274,7 @@ int freadMain(freadMainArgs _args) {
22742274
chunkBytes = bytesRead / nJumps;
22752275
} else {
22762276
ASSERT(nJumps == 1 /*when nrowLimit supplied*/ || nJumps == 2 /*small files*/, "nJumps (%d) != 1|2", nJumps);
2277-
nJumps=1;
2277+
nJumps = 1;
22782278
}
22792279
int64_t initialBuffRows = allocnrow / nJumps;
22802280

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

0 commit comments

Comments
 (0)