mirror of
https://github.com/fscotto/fsnap.git
synced 2026-11-26 03:09:51 +00:00
Fix remaining naming and style inconsistencies
- Add const to RecordObjectCompare parameters - Add static to crc32_table and table_computed in hash.c - Rename NewRecordObject to RecordObjectNew - Replace magic number 8192 with BUFFER_SIZE in utility.c - Unify comment style to /* */ across all files - Standardize _POSIX_C_SOURCE to 200809L - Remove unreachable dead code in diff.c
This commit is contained in:
@@ -31,7 +31,7 @@ static int load_in_memory(const char *file, struct RecordObject ***records,
|
||||
int i = 0;
|
||||
size_t size = 0;
|
||||
while (getline(&buf, &size, stream) != -1 && i < *count) {
|
||||
struct RecordObject *objp = NewRecordObject();
|
||||
struct RecordObject *objp = RecordObjectNew();
|
||||
if (objp == NULL) {
|
||||
errno = ENOMEM;
|
||||
goto failure;
|
||||
@@ -92,18 +92,12 @@ int diff(const char *file1, const char *file2) {
|
||||
int ret1 = load_in_memory(file1, &records1, &len1);
|
||||
if (ret1 == -1) {
|
||||
goto failure;
|
||||
} else if (ret1 > 0) {
|
||||
exit_failure = ret1;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
int len2 = 0;
|
||||
int ret2 = load_in_memory(file2, &records2, &len2);
|
||||
if (ret2 == -1) {
|
||||
goto failure;
|
||||
} else if (ret2 > 0) {
|
||||
exit_failure = ret2;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
qsort(records1, (size_t)len1, sizeof(records1[0]), order_by_path);
|
||||
|
||||
Reference in New Issue
Block a user