Skip to content

Commit 40e8027

Browse files
committed
switch to snake case + minor spelling correction
1 parent e473a08 commit 40e8027

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/fread.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ enum quote_rule_t
4747
// Fields may be quoted, but any quotes inside will appear verbatim and
4848
// not escaped in any way. It is not always possible to parse the file
4949
// unambiguously, but we give it a try anyways. A quote will be presumed
50-
// to mark the end of the field iff it is followed by the field separator.
50+
// to mark the end of the field if it is followed by the field separator.
5151
// Under this rule eol characters cannot appear inside the field.
5252
// For example: <<...,"hello "world"",...>>
5353
QUOTE_RULE_EMBEDDED_QUOTES_NOT_ESCAPED,
@@ -292,7 +292,7 @@ static inline bool eol(const char **pch)
292292
}
293293

294294
/**
295-
* Return True iff `ch` is a valid field terminator character: either a field
295+
* Return True if `ch` is a valid field terminator character: either a field
296296
* separator or a newline.
297297
*/
298298
static inline bool end_of_field(const char *ch)
@@ -453,15 +453,15 @@ static const char* filesize_to_str(const uint64_t fsize)
453453
return output;
454454
}
455455

456-
double copyFile(size_t fileSize) // only called in very very rare cases
456+
double copy_file(size_t file_size) // only called in very very rare cases
457457
{
458458
double tt = wallclock();
459-
mmp_copy = malloc(fileSize + 1 /* extra \0 */);
459+
mmp_copy = malloc(file_size + 1 /* extra \0 */);
460460
if (!mmp_copy)
461461
return -1.0; // # nocov
462-
memcpy(mmp_copy, mmp, fileSize);
462+
memcpy(mmp_copy, mmp, file_size);
463463
sof = mmp_copy;
464-
eof = (char*)OFFSET_POINTER(mmp_copy, fileSize);
464+
eof = (char*)OFFSET_POINTER(mmp_copy, file_size);
465465
return wallclock() - tt;
466466
}
467467

@@ -1603,7 +1603,7 @@ int freadMain(freadMainArgs _args)
16031603
if (verbose)
16041604
DTPRINT(_(" File ends abruptly with '%c'. Final end-of-line is missing. Copying file in RAM. %s.\n"), eof[-1], msg);
16051605
// In future, we may discover a way to mmap fileSize+1 on all OS when fileSize%4096==0, reliably. If and when, this clause can be updated with no code impact elsewhere.
1606-
double time_taken = copyFile(fileSize);
1606+
double time_taken = copy_file(fileSize);
16071607
if (time_taken == -1.0) {
16081608
// # nocov start
16091609
if (!verbose)
@@ -1892,7 +1892,7 @@ int freadMain(freadMainArgs _args)
18921892
if (verbose)
18931893
DTPRINT(_(" Copying file in RAM. %s\n"), msg);
18941894
ASSERT(mmp_copy == NULL, "mmp has already been copied due to abrupt non-eol ending, so it does not end with 2 or more eol.%s", ""/*dummy arg for macro*/); // #nocov
1895-
double time_taken = copyFile(fileSize);
1895+
double time_taken = copy_file(fileSize);
18961896
if (time_taken == -1.0) {
18971897
// # nocov start
18981898
if (!verbose)
@@ -1929,7 +1929,7 @@ int freadMain(freadMainArgs _args)
19291929
if (verbose) DTPRINT(_("[07] Detect column types, dec, good nrow estimate and whether first row is column names\n"));
19301930
if (verbose && args.header != NA_BOOL8) DTPRINT(_(" 'header' changed by user from 'auto' to %s\n"), args.header ? "true" : "false");
19311931

1932-
type = malloc(sizeof(*type) * ncol);
1932+
type = malloc(sizeof(*type) * ncol);
19331933
tmpType = malloc(sizeof(*tmpType) * ncol); // used i) in sampling to not stop on errors when bad jump point and ii) when accepting user overrides
19341934
if (!type || !tmpType) {
19351935
free(type); free(tmpType); // # nocov

0 commit comments

Comments
 (0)