From eef6afe2f1865411ffba06b8434734e208684828 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Thu, 3 Mar 2016 08:31:20 -0800 Subject: [PATCH] Prepare for running clang-format Some of the existing comments cause clang-format to reformat them strangely, so modify them to something more expected by the tool. Also, the tool may decide to "join" several lines of concatenated string literals if a line begins with a macro string literal. That's not wanted, so fix up that case too. Signed-off-by: Patrick McCarty --- src/main.c | 6 +++--- src/manifest.c | 23 +++++++++++++---------- src/pack.c | 4 ++-- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main.c b/src/main.c index b51ecf6..6b1ec37 100644 --- a/src/main.c +++ b/src/main.c @@ -296,7 +296,7 @@ int main(int argc, char **argv) match_manifests(old_full, new_full); apply_heuristics(new_full); #warning disabled rename detection for some simplicity -/* rename_detection(new_full); */ + // rename_detection(new_full); print_elapsed_time(&previous_time, ¤t_time); @@ -329,9 +329,9 @@ int main(int argc, char **argv) /* Step 3c: ... else save the manifest */ type_change_detection(new_core); - /* Detect renamed files specifically for each pack */ #warning disabled rename detection for some simplicity -/* rename_detection(...); */ + /* Detect renamed files specifically for each pack */ + // rename_detection(...); sort_manifest_by_version(new_core); newfiles = prune_manifest(new_core); diff --git a/src/manifest.c b/src/manifest.c index 68b9126..ab8755a 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -398,11 +398,13 @@ int match_manifests(struct manifest *m1, struct manifest *m2) } if (ret < 0) { struct file *file3; -/* - * if we get here, file1 got deleted... what we must do is add a file entry for it in the target list. - * However, since we're currently walking the list we HAVE to prepend the entry.. and mark for sort at - * the end. - */ + /* + * if we get here, file1 got deleted... what we must do + * is add a file entry for it in the target list. + * However, since we're currently walking the list we + * HAVE to prepend the entry.. and mark for sort at the + * end. + */ file3 = calloc(1, sizeof(struct file)); if (file3 == NULL) { assert(0); @@ -458,11 +460,12 @@ int match_manifests(struct manifest *m1, struct manifest *m2) first = 0; } count++; -/* - * if we get here, file1 got deleted... what we must do is add a file entry for it in the target list. - * However, since we're currently walking the list we HAVE to prepend the entry.. and mark for sort at - * the end. - */ + /* + * if we get here, file1 got deleted... what we must do is add + * a file entry for it in the target list. However, since + * we're currently walking the list we HAVE to prepend the + * entry.. and mark for sort at the end. + */ file3 = calloc(1, sizeof(struct file)); if (file3 == NULL) { assert(0); diff --git a/src/pack.c b/src/pack.c index 37ea343..7a4f465 100644 --- a/src/pack.c +++ b/src/pack.c @@ -113,8 +113,8 @@ static void explode_pack_stage(int version, char *module) * the resulting pack is slightly smaller, and in addition, we're saving CPU * time on the client... */ - string_or_die(&tar, "tar --directory=%s/%s/%i/staged --warning=no-timestamp " - TAR_PERM_ATTR_ARGS " -xf %s", packstage_dir, module, version, path); + string_or_die(&tar, "tar --directory=%s/%s/%i/staged --warning=no-timestamp " TAR_PERM_ATTR_ARGS + " -xf %s", packstage_dir, module, version, path); ret = system(tar); if (!ret) { unlink(path);