]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Improve order of parameters to common_header_*_file
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 19 Jun 2019 19:47:14 +0000 (21:47 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 26 Jun 2019 19:14:53 +0000 (21:14 +0200)
src/common_header.c
src/common_header.h
src/result.c

index db5a96b393fa10c1e9c46def45df1f7fe697bfc8..cdc6b8327f35482d7a3659bfac6eb3ce75f78668 100644 (file)
@@ -17,7 +17,7 @@
 #include "ccache.h"
 #include "common_header.h"
 
-bool common_header_from_file(FILE *f, struct common_header *header)
+bool common_header_from_file(struct common_header *header, FILE *f)
 {
        char buffer[COMMON_HEADER_SIZE];
        if (fread(buffer, 1, sizeof(buffer), f) != sizeof(buffer)) {
@@ -31,7 +31,7 @@ bool common_header_from_file(FILE *f, struct common_header *header)
        return true;
 }
 
-bool common_header_to_file(FILE *f, const struct common_header *header)
+bool common_header_to_file(const struct common_header *header, FILE *f)
 {
        char buffer[COMMON_HEADER_SIZE];
        memcpy(buffer, header->magic, 4);
index 3c2e9f5eaed24949f01753a247b492e4718f2025..09f1aa6e8388da5dd223cdd110cf0232046e7e94 100644 (file)
@@ -9,6 +9,6 @@ struct common_header
        uint64_t content_size;
 };
 
-bool common_header_from_file(FILE *f, struct common_header *header);
-bool common_header_to_file(FILE *f, const struct common_header *header);
 
+bool common_header_from_file(struct common_header *header, FILE *f);
+bool common_header_to_file(const struct common_header *header, FILE *f);
index 43f6bad508dc2028fa645e556def6d9c4222aca1..8b1831c355b7e8b04863d5a177752f6c98865606 100644 (file)
@@ -162,8 +162,8 @@ read_result(
        }
 
        struct common_header header;
-       if (!common_header_from_file(f, &header)) {
-               *errmsg = format("Failed to read result file header from %s", path);
+       if (!common_header_from_file(&header, f)) {
+               *errmsg = format("Failed to read header from %s", path);
                goto out;
        }
 
@@ -427,7 +427,7 @@ bool result_put(const char *path, struct result_files *list)
        }
        header.content_size = content_size;
 
-       if (!common_header_to_file(f, &header)) {
+       if (!common_header_to_file(&header, f)) {
                cc_log("Failed to write result file header to %s", tmp_file);
                goto out;
        }