From c5cdf144aea3d6f11617b7ea475ff34c4c55de30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 12 Aug 2018 17:01:05 +0200 Subject: Rename helper functions, as suggested in review --- src/ccache.c | 2 +- src/ccache.h | 4 ++-- src/execute.c | 2 +- src/util.c | 4 ++-- unittest/test_util.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ccache.c b/src/ccache.c index 6aac782c..3cf5d382 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -491,7 +491,7 @@ debug_end() { hash_debug_end(); char *path = format("%s%s", output_obj, ".ccache-log"); - cc_copylog(path); + cc_dump_log_buffer(path); free(path); } diff --git a/src/ccache.h b/src/ccache.h index a767ef32..40b8a1ef 100644 --- a/src/ccache.h +++ b/src/ccache.h @@ -139,7 +139,7 @@ bool hash_file(struct mdfour *md, const char *fname); void cc_log(const char *format, ...) ATTR_FORMAT(printf, 1, 2); void cc_bulklog(const char *format, ...) ATTR_FORMAT(printf, 1, 2); void cc_log_argv(const char *prefix, char **argv); -bool cc_copylog(const char *path); +bool cc_dump_log_buffer(const char *path); void fatal(const char *format, ...) ATTR_FORMAT(printf, 1, 2) ATTR_NORETURN; void warn(const char *format, ...) ATTR_FORMAT(printf, 1, 2); @@ -247,7 +247,7 @@ void wipe_all(struct conf *conf); int execute(char **argv, int fd_out, int fd_err, pid_t *pid); char *find_executable(const char *name, const char *exclude_name); void print_command(FILE *fp, char **argv); -char *string_command(char **argv); +char *format_command(char **argv); // ---------------------------------------------------------------------------- // lockfile.c diff --git a/src/execute.c b/src/execute.c index 4589a477..e56526f1 100644 --- a/src/execute.c +++ b/src/execute.c @@ -350,7 +350,7 @@ print_command(FILE *fp, char **argv) } char * -string_command(char **argv) +format_command(char **argv) { size_t len = 0; for (int i = 0; argv[i]; i++) { diff --git a/src/util.c b/src/util.c index b297e24e..d9143cea 100644 --- a/src/util.c +++ b/src/util.c @@ -200,7 +200,7 @@ cc_log_argv(const char *prefix, char **argv) } } if (logbuffer) { - char *s = string_command(argv); + char *s = format_command(argv); append_log(s, strlen(s)); free(s); } @@ -208,7 +208,7 @@ cc_log_argv(const char *prefix, char **argv) // Copy the current log memory buffer to an output file. bool -cc_copylog(const char *path) +cc_dump_log_buffer(const char *path) { FILE *file = fopen(path, "w"); fwrite(logbuffer, 1, logsize, file); diff --git a/unittest/test_util.c b/unittest/test_util.c index 4fed42cc..ae178e2a 100644 --- a/unittest/test_util.c +++ b/unittest/test_util.c @@ -199,11 +199,11 @@ TEST(parse_size_with_suffix) } } -TEST(string_command) +TEST(format_command) { char *argv[] = {"foo", "bar", NULL}; - CHECK_STR_EQ_FREE2("foo bar\n", string_command(argv)); + CHECK_STR_EQ_FREE2("foo bar\n", format_command(argv)); } -- cgit v1.2.1