]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Update source code style according to uncrustify
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 1 Aug 2015 20:56:03 +0000 (22:56 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 5 Aug 2015 15:40:00 +0000 (17:40 +0200)
24 files changed:
args.c
cleanup.c
compopt.c
conf.c
dev.mk.in
execute.c
exitfn.c
hash.c
hashutil.c
language.c
manifest.c
mdfour.c
murmurhashneutral2.c
stats.c
test/framework.c
test/main.c
test/test_args.c
test/test_argument_processing.c
test/test_conf.c
test/test_hash.c
test/test_hashutil.c
test/test_util.c
unify.c
util.c

diff --git a/args.c b/args.c
index 91fc47e7b3155d124c2f557260149eb9b9919eb2..a58848466addac9d025ffe014c0e1d19ab39f89b 100644 (file)
--- a/args.c
+++ b/args.c
@@ -103,7 +103,7 @@ args_init_from_gcc_atfile(const char *filename)
                        if (quoting) {
                                break;
                        }
-                       /* Fall through */
+               /* Fall through */
 
                case '\0':
                        /* end of token */
@@ -179,9 +179,9 @@ args_insert(struct args *dest, int index, struct args *src, bool replace)
        }
 
        dest->argv = (char **)x_realloc(
-               dest->argv,
-               (src->argc + dest->argc + 1 - offset) *
-               sizeof(char *));
+         dest->argv,
+         (src->argc + dest->argc + 1 - offset) *
+         sizeof(char *));
 
        /* Shift arguments over */
        for (i = dest->argc; i >= index + offset; i--) {
index 981423d9ab413d9480fabdd82bcc989672490939..df945e7b69f941351a5ea93a17ca2391e41d4aac 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -68,7 +68,8 @@ traverse_fn(const char *fname, struct stat *st)
        }
 
        if (str_startswith(p, ".nfs")) {
-               /* Ignore temporary NFS files that may be left for open but deleted files. */
+               /* Ignore temporary NFS files that may be left for open but deleted
+                * files. */
                goto out;
        }
 
index 26e15917b2d7678e9e221ffb6d61ca70caf40dca..f774fc16ffbbfb58cb48909607b1e1f605dea6e8 100644 (file)
--- a/compopt.c
+++ b/compopt.c
@@ -104,8 +104,8 @@ find(const char *option)
        struct compopt key;
        key.name = option;
        return bsearch(
-               &key, compopts, sizeof(compopts) / sizeof(compopts[0]),
-               sizeof(compopts[0]), compare_compopts);
+                &key, compopts, sizeof(compopts) / sizeof(compopts[0]),
+                sizeof(compopts[0]), compare_compopts);
 }
 
 static const struct compopt *
@@ -114,8 +114,8 @@ find_prefix(const char *option)
        struct compopt key;
        key.name = option;
        return bsearch(
-               &key, compopts, sizeof(compopts) / sizeof(compopts[0]),
-               sizeof(compopts[0]), compare_prefix_compopts);
+                &key, compopts, sizeof(compopts) / sizeof(compopts[0]),
+                sizeof(compopts[0]), compare_prefix_compopts);
 }
 
 /* Runs fn on the first two characters of option. */
diff --git a/conf.c b/conf.c
index 92c70c0648d5f5339fc28c889107f32f61c4bbb9..cc092f24dccfec7c363308955c3d6c7a94a6c736 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -157,7 +157,7 @@ parse_unsigned(const char *str, void *result, char **errmsg)
        }
 }
 
-static const char*
+static const char *
 bool_to_string(bool value)
 {
        return value ? "true" : "false";
@@ -193,9 +193,9 @@ verify_dir_levels(void *value, char **errmsg)
 }
 
 #define ITEM(name, type) \
-       parse_##type, offsetof(struct conf, name), NULL
+  parse_ ## type, offsetof(struct conf, name), NULL
 #define ITEM_V(name, type, verification) \
-       parse_##type, offsetof(struct conf, name), verify_##verification
+  parse_ ## type, offsetof(struct conf, name), verify_ ## verification
 
 #include "confitems_lookup.c"
 #include "envtoconfitems_lookup.c"
@@ -438,8 +438,8 @@ conf_update_from_environment(struct conf *conf, char **errmsg)
                }
 
                if (!handle_conf_setting(
-                           conf, env_to_conf_item->conf_name, q, &errmsg2, true, negate,
-                           "environment")) {
+                     conf, env_to_conf_item->conf_name, q, &errmsg2, true, negate,
+                     "environment")) {
                        *errmsg = format("%s: %s", key, errmsg2);
                        free(errmsg2);
                        free(key);
index 635c57a55a730bb124ea57594587619dbb011857..1261ad3a810070ce73aa038df01ea6adb79158d9 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -89,7 +89,8 @@ dist_files = \
 uncrustify_exclude_files = \
     getopt_long.c \
     hashtable.c \
-    hashtable_itr.c
+    hashtable_itr.c \
+    snprintf.c
 
 ifneq ($(shell sed 's/.*"\(.*\)".*/\1/' version.c 2>/dev/null),$(version))
   $(shell echo 'const char CCACHE_VERSION[] = "$(version)";' >version.c)
index 3b57a69713af7e8229fd3229bf184ddbffb86b7a..f48e67ceaf7863554c65b6564768cbf82db52ddd 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -186,23 +186,23 @@ win32execute(char *path, char **argv, int doreturn,
                DWORD dw = GetLastError();
 
                FormatMessage(
-                       FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                       FORMAT_MESSAGE_FROM_SYSTEM |
-                       FORMAT_MESSAGE_IGNORE_INSERTS,
-                       NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf,
-                       0, NULL);
+                 FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                 FORMAT_MESSAGE_FROM_SYSTEM |
+                 FORMAT_MESSAGE_IGNORE_INSERTS,
+                 NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf,
+                 0, NULL);
 
                lpDisplayBuf =
-                       (LPVOID) LocalAlloc(LMEM_ZEROINIT,
-                                           (lstrlen((LPCTSTR) lpMsgBuf)
-                                            + lstrlen((LPCTSTR) __FILE__) + 200)
-                                           * sizeof(TCHAR));
+                 (LPVOID) LocalAlloc(LMEM_ZEROINIT,
+                                     (lstrlen((LPCTSTR) lpMsgBuf)
+                                      + lstrlen((LPCTSTR) __FILE__) + 200)
+                                     * sizeof(TCHAR));
                _snprintf((LPTSTR) lpDisplayBuf,
                          LocalSize(lpDisplayBuf) / sizeof(TCHAR),
                          TEXT("%s failed with error %d: %s"), __FILE__, dw, lpMsgBuf);
 
                cc_log("can't execute %s; OS returned error: %s",
-                      full_path_win_ext, (char*)lpDisplayBuf);
+                      full_path_win_ext, (char *)lpDisplayBuf);
 
                LocalFree(lpMsgBuf);
                LocalFree(lpDisplayBuf);
@@ -220,10 +220,8 @@ win32execute(char *path, char **argv, int doreturn,
 
 #else
 
-/*
-  execute a compiler backend, capturing all output to the given paths
-  the full path to the compiler to run is in argv[0]
-*/
+/* Execute a compiler backend, capturing all output to the given paths the full
+ * path to the compiler to run is in argv[0]. */
 int
 execute(char **argv, int fd_out, int fd_err)
 {
@@ -264,7 +262,7 @@ execute(char **argv, int fd_out, int fd_err)
 /*
  * Find an executable by name in $PATH. Exclude any that are links to
  * exclude_name.
-*/
+ */
 char *
 find_executable(const char *name, const char *exclude_name)
 {
index 5d76eeeada72f4f249bd4ceacbc692499aeba754..29b7b9f16a4d00e652c01827de81dd48bd0f011c 100644 (file)
--- a/exitfn.c
+++ b/exitfn.c
@@ -33,7 +33,7 @@ static struct exit_function *exit_functions;
 static void
 call_nullary_exit_function(void *context)
 {
-       struct nullary_exit_function *p = (struct nullary_exit_function*)context;
+       struct nullary_exit_function *p = (struct nullary_exit_function *)context;
        p->function();
        free(p);
 }
diff --git a/hash.c b/hash.c
index 7950737890f99744d4352353256932c6b72ecd5a..6f23bb94d842427e5a73157b4c2c765e49ec1dbe 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -86,7 +86,7 @@ hash_string(struct mdfour *md, const char *s)
 void
 hash_string_length(struct mdfour *md, const char *s, int length)
 {
-        hash_buffer(md, s, length);
+       hash_buffer(md, s, length);
 }
 
 void
index b8103a630bfe458347470c1e770fc6b36efa70fd..6c4b2799f140eedadb69981c05ee6d6ef3d18331 100644 (file)
@@ -43,7 +43,7 @@ int
 file_hashes_equal(struct file_hash *fh1, struct file_hash *fh2)
 {
        return memcmp(fh1->hash, fh2->hash, 16) == 0
-               && fh1->size == fh2->size;
+              && fh1->size == fh2->size;
 }
 
 /*
@@ -82,9 +82,8 @@ check_for_temporal_macros(const char *str, size_t len)
                        if (str[i - 5] == 'D' && str[i - 4] == 'A' &&
                            str[i - 3] == 'T') {
                                result |= HASH_SOURCE_CODE_FOUND_DATE;
-                       }
-                       else if (str[i - 5] == 'T' && str[i - 4] == 'I' &&
-                                str[i - 3] == 'M') {
+                       } else if (str[i - 5] == 'T' && str[i - 4] == 'I' &&
+                                  str[i - 3] == 'M') {
                                result |= HASH_SOURCE_CODE_FOUND_TIME;
                        }
                }
@@ -104,8 +103,8 @@ check_for_temporal_macros(const char *str, size_t len)
  */
 int
 hash_source_code_string(
-       struct conf *conf, struct mdfour *hash, const char *str, size_t len,
-       const char *path)
+  struct conf *conf, struct mdfour *hash, const char *str, size_t len,
+  const char *path)
 {
        int result = HASH_SOURCE_CODE_OK;
 
@@ -223,9 +222,9 @@ hash_command_output(struct mdfour *hash, const char *command,
        CreatePipe(&pipe_out[0], &pipe_out[1], &sa, 0);
        SetHandleInformation(pipe_out[0], HANDLE_FLAG_INHERIT, 0);
        si.hStdOutput = pipe_out[1];
-       si.hStdError  = pipe_out[1];
-       si.hStdInput  = GetStdHandle(STD_INPUT_HANDLE);
-       si.dwFlags    = STARTF_USESTDHANDLES;
+       si.hStdError = pipe_out[1];
+       si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+       si.dwFlags = STARTF_USESTDHANDLES;
        win32args = win32argvtos(sh, args->argv);
        ret = CreateProcess(path, win32args, NULL, NULL, 1, 0, NULL, NULL, &si, &pi);
        CloseHandle(pipe_out[1]);
index 110066ac957c823241566637e8bbbe657cca04f8..78c4a7d0262d8ee38693c55832905918c5d59eb2 100644 (file)
@@ -61,7 +61,8 @@ static const struct {
        {".HXX", "c++-header"},
        {".tcc", "c++-header"},
        {".TCC", "c++-header"},
-       {NULL,  NULL}};
+       {NULL,  NULL}
+};
 
 /*
  * Supported languages and corresponding preprocessed languages.
@@ -84,7 +85,8 @@ static const struct {
        {"objc++-cpp-output",        "objective-c++-cpp-output"},
        {"objective-c++-header",     "objective-c++-cpp-output"},
        {"objective-c++-cpp-output", "objective-c++-cpp-output"},
-       {NULL,  NULL}};
+       {NULL,  NULL}
+};
 
 /*
  * Guess the language of a file based on its extension. Returns NULL if the
index 1dcf83f68f40ec60a6b053fd5c5f82c3d7eeeec8..8a0ecbbcb4d2b88d692c4db961e83cab76189640 100644 (file)
@@ -71,7 +71,7 @@ static const uint32_t MAX_MANIFEST_ENTRIES = 100;
 static const uint32_t MAX_MANIFEST_FILE_INFO_ENTRIES = 10000;
 
 #define ccache_static_assert(e) \
-       do { enum { ccache_static_assert__ = 1/(e) }; } while (false)
+  do { enum { ccache_static_assert__ = 1/(e) }; } while (false)
 
 struct file_info {
        /* Index to n_files. */
@@ -160,7 +160,7 @@ free_manifest(struct manifest *mf)
 }
 
 #define READ_BYTE(var) \
-       do { \
+  do { \
                int ch_; \
                ch_ = gzgetc(f); \
                if (ch_ == EOF) { \
@@ -170,7 +170,7 @@ free_manifest(struct manifest *mf)
        } while (false)
 
 #define READ_INT(size, var) \
-       do { \
+  do { \
                int ch_; \
                size_t i_; \
                (var) = 0; \
@@ -185,7 +185,7 @@ free_manifest(struct manifest *mf)
        } while (false)
 
 #define READ_STR(var) \
-       do { \
+  do { \
                char buf_[1024]; \
                size_t i_; \
                int ch_; \
@@ -206,7 +206,7 @@ free_manifest(struct manifest *mf)
        } while (false)
 
 #define READ_BYTES(n, var) \
-       do { \
+  do { \
                size_t i_; \
                int ch_; \
                for (i_ = 0; i_ < (n); i_++) { \
@@ -288,8 +288,8 @@ read_manifest(gzFile f)
        for (i = 0; i < mf->n_objects; i++) {
                READ_INT(4, mf->objects[i].n_file_info_indexes);
                mf->objects[i].file_info_indexes =
-                       x_calloc(mf->objects[i].n_file_info_indexes,
-                                sizeof(*mf->objects[i].file_info_indexes));
+                 x_calloc(mf->objects[i].n_file_info_indexes,
+                          sizeof(*mf->objects[i].file_info_indexes));
                for (j = 0; j < mf->objects[i].n_file_info_indexes; j++) {
                        READ_INT(4, mf->objects[i].file_info_indexes[j]);
                }
@@ -306,7 +306,7 @@ error:
 }
 
 #define WRITE_INT(size, var) \
-       do { \
+  do { \
                uint8_t ch_; \
                size_t i_; \
                for (i_ = 0; i_ < (size); i_++) { \
@@ -318,14 +318,14 @@ error:
        } while (false)
 
 #define WRITE_STR(var) \
-       do { \
+  do { \
                if (gzputs(f, var) == EOF || gzputc(f, '\0') == EOF) { \
                        goto error; \
                } \
        } while (false)
 
 #define WRITE_BYTES(n, var) \
-       do { \
+  do { \
                size_t i_; \
                for (i_ = 0; i_ < (n); i_++) { \
                        if (gzputc(f, (var)[i_]) == EOF) { \
@@ -415,8 +415,7 @@ verify_object(struct conf *conf, struct manifest *mf, struct object *obj,
                            && MAX(st->mtime, st->ctime) >= time_of_compilation) {
                                cc_log("size/mtime/ctime hit for %s", path);
                                continue;
-                       }
-                       else {
+                       } else {
                                cc_log("size/mtime/ctime miss for %s", path);
                        }
                }
@@ -532,8 +531,7 @@ get_file_hash_index(struct manifest *mf,
            && time_of_compilation > MAX(file_stat.st_mtime, file_stat.st_ctime)) {
                fi.mtime = file_stat.st_mtime;
                fi.ctime = file_stat.st_ctime;
-       }
-       else {
+       } else {
                fi.mtime = -1;
                fi.ctime = -1;
        }
index 06bc17fa6e0f6a376f6b49be82b7eb8ff48216cb..43b5bb61b72a516bb07b66cbdc36b188b10bf11e 100644 (file)
--- a/mdfour.c
+++ b/mdfour.c
@@ -30,8 +30,10 @@ static struct mdfour *m;
 #define lshift(x,s) (((((x)<<(s))&MASK32) | (((x)>>(32-(s)))&MASK32)))
 
 #define ROUND1(a,b,c,d,k,s) a = lshift((a + F(b,c,d) + M[k])&MASK32, s)
-#define ROUND2(a,b,c,d,k,s) a = lshift((a + G(b,c,d) + M[k] + 0x5A827999)&MASK32,s)
-#define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c,d) + M[k] + 0x6ED9EBA1)&MASK32,s)
+#define ROUND2(a,b,c,d,k,s) a = lshift((a + G(b,c, \
+                                              d) + M[k] + 0x5A827999)&MASK32,s)
+#define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c, \
+                                              d) + M[k] + 0x6ED9EBA1)&MASK32,s)
 
 /* this applies md4 to 64 byte chunks */
 static void
@@ -88,7 +90,7 @@ copy64(uint32_t *M, const unsigned char *in)
 
        for (i = 0; i < 16; i++)
                M[i] = (in[i*4+3]<<24) | (in[i*4+2]<<16) |
-                       (in[i*4+1]<<8) | (in[i*4+0]<<0);
+                      (in[i*4+1]<<8) | (in[i*4+0]<<0);
 #else
        memcpy(M, in, 16*4);
 #endif
@@ -155,7 +157,7 @@ mdfour_update(struct mdfour *md, const unsigned char *in, size_t n)
 
 #ifdef CCACHE_DEBUG_HASH
        if (getenv("CCACHE_DEBUG_HASH")) {
-               FILEf = fopen("ccache-debug-hash.bin", "a");
+               FILE *f = fopen("ccache-debug-hash.bin", "a");
                fwrite(in, 1, n, f);
                fclose(f);
        }
index e625ba8b4708219260bd4393abf37b5f437b6f11..cd891335aa0f4981a96fb56622d7bb5f37602584 100644 (file)
@@ -18,7 +18,7 @@ murmurhashneutral2(const void *key, int len, unsigned int seed)
        while (len >= 4) {
                unsigned int k;
 
-               k  = data[0];
+               k = data[0];
                k |= data[1] << 8;
                k |= data[2] << 16;
                k |= data[3] << 24;
@@ -39,7 +39,7 @@ murmurhashneutral2(const void *key, int len, unsigned int seed)
        case 3: h ^= data[2] << 16;
        case 2: h ^= data[1] << 8;
        case 1: h ^= data[0];
-               h *= m;
+               h *= m;
        };
 
        h ^= h >> 13;
diff --git a/stats.c b/stats.c
index 72985b46e90e9b5f4fc017d6ab5fc0c813d54191..d6f428eea87d494d7fd152992a4e29f60fedf956 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -78,10 +78,14 @@ static struct {
        { STATS_DEVICE,       "output to a non-regular file   ", NULL, 0 },
        { STATS_NOINPUT,      "no input file                  ", NULL, 0 },
        { STATS_BADEXTRAFILE, "error hashing extra file       ", NULL, 0 },
-       { STATS_NUMFILES,     "files in cache                 ", NULL, FLAG_NOZERO|FLAG_ALWAYS },
-       { STATS_TOTALSIZE,    "cache size                     ", display_size_times_1024 , FLAG_NOZERO|FLAG_ALWAYS },
-       { STATS_OBSOLETE_MAXFILES, "OBSOLETE",                   NULL, FLAG_NOZERO|FLAG_NEVER},
-       { STATS_OBSOLETE_MAXSIZE, "OBSOLETE",                    NULL, FLAG_NOZERO|FLAG_NEVER},
+       { STATS_NUMFILES,     "files in cache                 ", NULL,
+               FLAG_NOZERO|FLAG_ALWAYS },
+       { STATS_TOTALSIZE,    "cache size                     ",
+               display_size_times_1024, FLAG_NOZERO|FLAG_ALWAYS },
+       { STATS_OBSOLETE_MAXFILES, "OBSOLETE",                   NULL,
+               FLAG_NOZERO|FLAG_NEVER},
+       { STATS_OBSOLETE_MAXSIZE, "OBSOLETE",                    NULL,
+               FLAG_NOZERO|FLAG_NEVER},
        { STATS_NONE, NULL, NULL, 0 }
 };
 
index 3590d032c2476695e7d92ebb74c489a75a409fb8..c15e2f025237d657b5c1efecae7b421a731ac1c7 100644 (file)
@@ -39,7 +39,7 @@ static const char COLOR_END[] = "\x1b[m";
 static const char COLOR_GREEN[] = "\x1b[32m";
 static const char COLOR_RED[] = "\x1b[31m";
 
-#define COLOR(tty, color) ((tty) ? COLOR_##color : "")
+#define COLOR(tty, color) ((tty) ? COLOR_ ## color : "")
 
 static int
 is_tty(int fd)
index 82f96699cd914be88196790b1e0b0aa4a7d2abd4..15943cf53c42c2b68d266b89e50e2055c912fdd1 100644 (file)
 #include "getopt_long.h"
 #endif
 
-#define SUITE(name) unsigned suite_##name(unsigned);
+#define SUITE(name) unsigned suite_ ## name(unsigned);
 #include "test/suites.h"
 #undef SUITE
 
 const char USAGE_TEXT[] =
-       "Usage:\n"
-       "    test [options]\n"
-       "\n"
-       "Options:\n"
-       "    -h, --help      print this help text\n"
-       "    -v, --verbose   enable verbose logging of tests\n";
+  "Usage:\n"
+  "    test [options]\n"
+  "\n"
+  "Options:\n"
+  "    -h, --help      print this help text\n"
+  "    -v, --verbose   enable verbose logging of tests\n";
 
 int
 main(int argc, char **argv)
 {
        suite_fn suites[] = {
-#define SUITE(name) &suite_##name,
+#define SUITE(name) &suite_ ## name,
 #include "test/suites.h"
 #undef SUITE
                NULL
index 27c6fb9d06d2370f8849e8bb95895fb6f7adca03..d0a3bac55ff1235f17f8c4c3367c09df4c8aaca1 100644 (file)
@@ -64,8 +64,8 @@ TEST(args_init_from_gcc_atfile)
 {
        struct args *args;
        const char *argtext =
-               "first\rsec\\\tond\tthi\\\\rd\nfourth  \tfif\\ th \"si'x\\\" th\""
-               " 'seve\nth'\\";
+         "first\rsec\\\tond\tthi\\\\rd\nfourth  \tfif\\ th \"si'x\\\" th\""
+         " 'seve\nth'\\";
 
        create_file("gcc_atfile", argtext);
 
@@ -198,13 +198,13 @@ TEST(args_insert)
        CHECK_INT_EQ(9, args->argc);
        args_insert(args, 1, src5, false);
        CHECK_STR_EQ_FREE2(
-               "first one alpha beta gamma second beta gamma fourth fifth",
-               args_to_string(args));
+         "first one alpha beta gamma second beta gamma fourth fifth",
+         args_to_string(args));
        CHECK_INT_EQ(10, args->argc);
        args_insert(args, 1, src6, false);
        CHECK_STR_EQ_FREE2(
-               "first one alpha beta gamma second beta gamma fourth fifth",
-               args_to_string(args));
+         "first one alpha beta gamma second beta gamma fourth fifth",
+         args_to_string(args));
        CHECK_INT_EQ(10, args->argc);
 
        args_free(args);
index e0a44794908022a7afee89d1c116fb074e031aa4..5f75654a05a7d1d87fc1b7ce99e408d90cdd47e6 100644 (file)
@@ -79,7 +79,7 @@ TEST(preprocessor_only_flags_should_only_be_sent_to_the_preprocessor)
        " -include test.h -include-pch test.pch -iprefix . -iquote ." \
        " -isysroot . -isystem . -iwithprefix . -iwithprefixbefore ." \
        " -DTEST_MACRO -DTEST_MACRO2=1 -F. -trigraphs -fworking-directory" \
-       " -fno-working-directory -MD -MMD -MP -MF foo.d -MT mt1 -MT mt2 "\
+       " -fno-working-directory -MD -MMD -MP -MF foo.d -MT mt1 -MT mt2 " \
        " -MQ mq1 -MQ mq2 -Wp,-MD,wpmd -Wp,-MMD,wpmmd"
        struct args *orig = args_init_from_string(CMD " -c foo.c -o foo.o");
        struct args *exp_cpp = args_init_from_string(CMD);
@@ -98,9 +98,9 @@ TEST(preprocessor_only_flags_should_only_be_sent_to_the_preprocessor)
 TEST(dependency_flags_that_take_an_argument_should_not_require_space_delimiter)
 {
        struct args *orig = args_init_from_string(
-               "cc -c -MMD -MFfoo.d -MT mt -MTmt -MQmq foo.c -o foo.o");
+         "cc -c -MMD -MFfoo.d -MT mt -MTmt -MQmq foo.c -o foo.o");
        struct args *exp_cpp = args_init_from_string(
-               "cc -MMD -MFfoo.d -MT mt -MTmt -MQmq");
+         "cc -MMD -MFfoo.d -MT mt -MTmt -MQmq");
        struct args *exp_cc = args_init_from_string("cc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -137,9 +137,9 @@ TEST(sysroot_should_be_rewritten_if_basedir_is_used)
 TEST(MF_flag_with_immediate_argument_should_work_as_last_argument)
 {
        struct args *orig = args_init_from_string(
-               "cc -c foo.c -o foo.o -MMD -MT bar -MFfoo.d");
+         "cc -c foo.c -o foo.o -MMD -MT bar -MFfoo.d");
        struct args *exp_cpp = args_init_from_string(
-               "cc -MMD -MT bar -MFfoo.d");
+         "cc -MMD -MT bar -MFfoo.d");
        struct args *exp_cc = args_init_from_string("cc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -154,9 +154,9 @@ TEST(MF_flag_with_immediate_argument_should_work_as_last_argument)
 TEST(MT_flag_with_immediate_argument_should_work_as_last_argument)
 {
        struct args *orig = args_init_from_string(
-               "cc -c foo.c -o foo.o -MMD -MFfoo.d -MT foo -MTbar");
+         "cc -c foo.c -o foo.o -MMD -MFfoo.d -MT foo -MTbar");
        struct args *exp_cpp = args_init_from_string(
-               "cc -MMD -MFfoo.d -MT foo -MTbar");
+         "cc -MMD -MFfoo.d -MT foo -MTbar");
        struct args *exp_cc = args_init_from_string("cc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -171,9 +171,9 @@ TEST(MT_flag_with_immediate_argument_should_work_as_last_argument)
 TEST(MQ_flag_with_immediate_argument_should_work_as_last_argument)
 {
        struct args *orig = args_init_from_string(
-               "cc -c foo.c -o foo.o -MMD -MFfoo.d -MQ foo -MQbar");
+         "cc -c foo.c -o foo.o -MMD -MFfoo.d -MQ foo -MQbar");
        struct args *exp_cpp = args_init_from_string(
-               "cc -MMD -MFfoo.d -MQ foo -MQbar");
+         "cc -MMD -MFfoo.d -MQ foo -MQbar");
        struct args *exp_cc = args_init_from_string("cc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -188,9 +188,9 @@ TEST(MQ_flag_with_immediate_argument_should_work_as_last_argument)
 TEST(MQ_flag_without_immediate_argument_should_not_add_MQobj)
 {
        struct args *orig = args_init_from_string(
-               "gcc -c -MD -MP -MFfoo.d -MQ foo.d foo.c");
+         "gcc -c -MD -MP -MFfoo.d -MQ foo.d foo.c");
        struct args *exp_cpp = args_init_from_string(
-               "gcc -MD -MP -MFfoo.d -MQ foo.d");
+         "gcc -MD -MP -MFfoo.d -MQ foo.d");
        struct args *exp_cc = args_init_from_string("gcc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -205,9 +205,9 @@ TEST(MQ_flag_without_immediate_argument_should_not_add_MQobj)
 TEST(MT_flag_without_immediate_argument_should_not_add_MTobj)
 {
        struct args *orig = args_init_from_string(
-               "gcc -c -MD -MP -MFfoo.d -MT foo.d foo.c");
+         "gcc -c -MD -MP -MFfoo.d -MT foo.d foo.c");
        struct args *exp_cpp = args_init_from_string(
-               "gcc -MD -MP -MFfoo.d -MT foo.d");
+         "gcc -MD -MP -MFfoo.d -MT foo.d");
        struct args *exp_cc = args_init_from_string("gcc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -222,9 +222,9 @@ TEST(MT_flag_without_immediate_argument_should_not_add_MTobj)
 TEST(MQ_flag_with_immediate_argument_should_not_add_MQobj)
 {
        struct args *orig = args_init_from_string(
-               "gcc -c -MD -MP -MFfoo.d -MQfoo.d foo.c");
+         "gcc -c -MD -MP -MFfoo.d -MQfoo.d foo.c");
        struct args *exp_cpp = args_init_from_string(
-               "gcc -MD -MP -MFfoo.d -MQfoo.d");
+         "gcc -MD -MP -MFfoo.d -MQfoo.d");
        struct args *exp_cc = args_init_from_string("gcc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -239,9 +239,9 @@ TEST(MQ_flag_with_immediate_argument_should_not_add_MQobj)
 TEST(MT_flag_with_immediate_argument_should_not_add_MQobj)
 {
        struct args *orig = args_init_from_string(
-               "gcc -c -MD -MP -MFfoo.d -MTfoo.d foo.c");
+         "gcc -c -MD -MP -MFfoo.d -MTfoo.d foo.c");
        struct args *exp_cpp = args_init_from_string(
-               "gcc -MD -MP -MFfoo.d -MTfoo.d");
+         "gcc -MD -MP -MFfoo.d -MTfoo.d");
        struct args *exp_cc = args_init_from_string("gcc -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
        create_file("foo.c", "");
@@ -256,7 +256,7 @@ TEST(MT_flag_with_immediate_argument_should_not_add_MQobj)
 TEST(fprofile_flag_with_existing_dir_should_be_rewritten_to_real_path)
 {
        struct args *orig = args_init_from_string(
-               "gcc -c -fprofile-generate=some/dir foo.c");
+         "gcc -c -fprofile-generate=some/dir foo.c");
        struct args *exp_cpp = args_init_from_string("gcc");
        struct args *exp_cc = args_init_from_string("gcc");
        struct args *act_cpp = NULL, *act_cc = NULL;
@@ -281,11 +281,11 @@ TEST(fprofile_flag_with_existing_dir_should_be_rewritten_to_real_path)
 TEST(fprofile_flag_with_nonexisting_dir_not_be_rewritten)
 {
        struct args *orig = args_init_from_string(
-               "gcc -c -fprofile-generate=some/dir foo.c");
+         "gcc -c -fprofile-generate=some/dir foo.c");
        struct args *exp_cpp = args_init_from_string(
-               "gcc -fprofile-generate=some/dir");
+         "gcc -fprofile-generate=some/dir");
        struct args *exp_cc = args_init_from_string(
-               "gcc -fprofile-generate=some/dir -c");
+         "gcc -fprofile-generate=some/dir -c");
        struct args *act_cpp = NULL, *act_cc = NULL;
 
        create_file("foo.c", "");
index 46be7807a5c9bcfa3fc0a5c5da60a4464b203f26..df344c553bfc37d0de555c363ada36f0996d19e6 100644 (file)
@@ -89,38 +89,38 @@ TEST(conf_read_valid_config)
        user = getenv("USER");
        CHECK_STR_EQ("rabbit", user);
        create_file(
-               "ccache.conf",
-               "base_dir =  /$USER/foo/${USER} \n"
-               "cache_dir=\n"
-               "cache_dir = $USER$/${USER}/.ccache\n"
-               "\n"
-               "\n"
-               "  #A comment\n"
-               " cache_dir_levels = 4\n"
-               "\t compiler = foo\n"
-               "compiler_check = none\n"
-               "compression=true\n"
-               "compression_level= 2\n"
-               "cpp_extension = .foo\n"
-               "direct_mode = false\n"
-               "disable = true\n"
-               "extra_files_to_hash = a:b c:$USER\n"
-               "hard_link = true\n"
-               "hash_dir = true\n"
-               "log_file = $USER${USER} \n"
-               "max_files = 17\n"
-               "max_size = 123M\n"
-               "path = $USER.x\n"
-               "prefix_command = x$USER\n"
-               "read_only = true\n"
-               "read_only_direct = true\n"
-               "recache = true\n"
-               "run_second_cpp = true\n"
-               "sloppiness =     file_macro   ,time_macros,  include_file_mtime,include_file_ctime,file_stat_matches  pch_defines  \n"
-               "stats = false\n"
-               "temporary_dir = ${USER}_foo\n"
-               "umask = 777\n"
-               "unify = true"); /* Note: no newline */
+         "ccache.conf",
+         "base_dir =  /$USER/foo/${USER} \n"
+         "cache_dir=\n"
+         "cache_dir = $USER$/${USER}/.ccache\n"
+         "\n"
+         "\n"
+         "  #A comment\n"
+         " cache_dir_levels = 4\n"
+         "\t compiler = foo\n"
+         "compiler_check = none\n"
+         "compression=true\n"
+         "compression_level= 2\n"
+         "cpp_extension = .foo\n"
+         "direct_mode = false\n"
+         "disable = true\n"
+         "extra_files_to_hash = a:b c:$USER\n"
+         "hard_link = true\n"
+         "hash_dir = true\n"
+         "log_file = $USER${USER} \n"
+         "max_files = 17\n"
+         "max_size = 123M\n"
+         "path = $USER.x\n"
+         "prefix_command = x$USER\n"
+         "read_only = true\n"
+         "read_only_direct = true\n"
+         "recache = true\n"
+         "run_second_cpp = true\n"
+         "sloppiness =     file_macro   ,time_macros,  include_file_mtime,include_file_ctime,file_stat_matches  pch_defines  \n"
+         "stats = false\n"
+         "temporary_dir = ${USER}_foo\n"
+         "umask = 777\n"
+         "unify = true"); /* Note: no newline */
        CHECK(conf_read(conf, "ccache.conf", &errmsg));
        CHECK(!errmsg);
 
@@ -288,12 +288,14 @@ TEST(verify_dir_levels)
 
        create_file("ccache.conf", "cache_dir_levels = 0");
        CHECK(!conf_read(conf, "ccache.conf", &errmsg));
-       CHECK_STR_EQ_FREE2("ccache.conf:1: cache directory levels must be between 1 and 8",
-                          errmsg);
+       CHECK_STR_EQ_FREE2(
+         "ccache.conf:1: cache directory levels must be between 1 and 8",
+         errmsg);
        create_file("ccache.conf", "cache_dir_levels = 9");
        CHECK(!conf_read(conf, "ccache.conf", &errmsg));
-       CHECK_STR_EQ_FREE2("ccache.conf:1: cache directory levels must be between 1 and 8",
-                          errmsg);
+       CHECK_STR_EQ_FREE2(
+         "ccache.conf:1: cache directory levels must be between 1 and 8",
+         errmsg);
 
        conf_free(conf);
 }
@@ -366,8 +368,8 @@ TEST(conf_print_items)
                true,
                true,
                SLOPPY_FILE_MACRO|SLOPPY_INCLUDE_FILE_MTIME|
-                 SLOPPY_INCLUDE_FILE_CTIME|SLOPPY_TIME_MACROS|
-                 SLOPPY_FILE_STAT_MATCHES,
+               SLOPPY_INCLUDE_FILE_CTIME|SLOPPY_TIME_MACROS|
+               SLOPPY_FILE_STAT_MATCHES,
                false,
                "td",
                022,
index b9d58fbd666f98975e2045a39c2c2c5417ab0c61..46f65db9731949507adcc4fab66c4e5db2c58c5f 100644 (file)
@@ -42,7 +42,9 @@ TEST(test_vectors_from_rfc_1320_should_be_correct)
        CHECK_STR_EQ_FREE2("d9130a8164549fe818874806e1c7014b-14", hash_result(&h));
 
        hash_start(&h);
-       hash_string(&h, "12345678901234567890123456789012345678901234567890123456789012345678901234567890");
+       hash_string(
+         &h,
+         "12345678901234567890123456789012345678901234567890123456789012345678901234567890");
        CHECK_STR_EQ_FREE2("e33b4ddc9c38f2199c3e7b164fcc0536-80", hash_result(&h));
 }
 
index 98316f014936d84e58f9cc324bb45bb8cac99f91..9b6fd349550ea3a7fed8dcbb20221a92bb7a0faa 100644 (file)
@@ -102,38 +102,38 @@ TEST(hash_multicommand_output_error_handling)
 TEST(check_for_temporal_macros)
 {
        const char time_start[] =
-               "__TIME__\n"
-               "int a;\n";
+         "__TIME__\n"
+         "int a;\n";
        const char time_middle[] =
-               "#define a __TIME__\n"
-               "int a;\n";
+         "#define a __TIME__\n"
+         "int a;\n";
        const char time_end[] =
-               "#define a __TIME__";
+         "#define a __TIME__";
 
        const char date_start[] =
-               "__DATE__\n"
-               "int ab;\n";
+         "__DATE__\n"
+         "int ab;\n";
        const char date_middle[] =
-               "#define ab __DATE__\n"
-               "int ab;\n";
+         "#define ab __DATE__\n"
+         "int ab;\n";
        const char date_end[] =
-               "#define ab __DATE__";
+         "#define ab __DATE__";
 
        const char no_temporal[] =
-               "#define ab _ _DATE__\n"
-               "#define ab __ DATE__\n"
-               "#define ab __D ATE__\n"
-               "#define ab __DA TE__\n"
-               "#define ab __DAT E__\n"
-               "#define ab __DATE __\n"
-               "#define ab __DATE_ _\n"
-               "#define ab _ _TIME__\n"
-               "#define ab __ TIME__\n"
-               "#define ab __T IME__\n"
-               "#define ab __TI ME__\n"
-               "#define ab __TIM E__\n"
-               "#define ab __TIME __\n"
-               "#define ab __TIME_ _\n";
+         "#define ab _ _DATE__\n"
+         "#define ab __ DATE__\n"
+         "#define ab __D ATE__\n"
+         "#define ab __DA TE__\n"
+         "#define ab __DAT E__\n"
+         "#define ab __DATE __\n"
+         "#define ab __DATE_ _\n"
+         "#define ab _ _TIME__\n"
+         "#define ab __ TIME__\n"
+         "#define ab __T IME__\n"
+         "#define ab __TI ME__\n"
+         "#define ab __TIM E__\n"
+         "#define ab __TIME __\n"
+         "#define ab __TIME_ _\n";
 
        CHECK(check_for_temporal_macros(time_start + 0, sizeof(time_start) - 0));
        CHECK(!check_for_temporal_macros(time_start + 1, sizeof(time_start) - 1));
index 156789d63b4ec18d18ca37e0cd660283424249f0..395546fe90a817d410ff7134435fac8ef66bb9f1 100644 (file)
@@ -77,7 +77,8 @@ TEST(get_relative_path)
 TEST(format_hash_as_string)
 {
        unsigned char hash[16] = {
-               "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"};
+               "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+       };
 
        CHECK_STR_EQ_FREE2("00000000000000000000000000000000",
                           format_hash_as_string(hash, -1));
@@ -154,8 +155,8 @@ TEST(format_parsable_size_with_suffix)
        CHECK_STR_EQ_FREE2("1.0G",
                           format_parsable_size_with_suffix(1000 * 1000 * 1000));
        CHECK_STR_EQ_FREE2(
-               "17.1G",
-               format_parsable_size_with_suffix(17.11 * 1000 * 1000 * 1000));
+         "17.1G",
+         format_parsable_size_with_suffix(17.11 * 1000 * 1000 * 1000));
 }
 
 TEST(parse_size_with_suffix)
diff --git a/unify.c b/unify.c
index 3128623db8b39e3e7c4b3453bbe27a5f7ae261a0..6f19ea809500f3de9fd4b27fc586102bc47420fa 100644 (file)
--- a/unify.c
+++ b/unify.c
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc., 51
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ */
 
 /*
  * C/C++ unifier
@@ -137,7 +137,7 @@ unify(struct mdfour *hash, unsigned char *p, size_t size)
 
        build_table();
 
-       for (ofs = 0; ofs < size;) {
+       for (ofs = 0; ofs < size; ) {
                if (p[ofs] == '#') {
                        if ((size-ofs) > 2 && p[ofs+1] == ' ' && isdigit(p[ofs+2])) {
                                do {
@@ -169,7 +169,7 @@ unify(struct mdfour *hash, unsigned char *p, size_t size)
                                pushchar(hash, p[ofs]);
                                ofs++;
                        } while (ofs < size &&
-                                ((tokens[p[ofs]].type & C_DIGIT) || p[ofs] == '.'));
+                                ((tokens[p[ofs]].type & C_DIGIT) || p[ofs] == '.'));
                        if (ofs < size && (p[ofs] == 'x' || p[ofs] == 'X')) {
                                do {
                                        pushchar(hash, p[ofs]);
@@ -246,7 +246,7 @@ unify(struct mdfour *hash, unsigned char *p, size_t size)
 
 /* hash a file that consists of preprocessor output, but remove any line
    number information from the hash
-*/
+ */
 int
 unify_hash(struct mdfour *hash, const char *fname)
 {
diff --git a/util.c b/util.c
index 5cc9795cc1b2884877c35694d62d6f328e523aef..2526bbe496cdf0e43d4ebac0f92d0d543580d7c4 100644 (file)
--- a/util.c
+++ b/util.c
@@ -74,7 +74,7 @@ log_prefix(bool log_updated_time)
        if (log_updated_time) {
                gettimeofday(&tv, NULL);
 #ifdef __MINGW64_VERSION_MAJOR
-               tm = localtime((time_t*)&tv.tv_sec);
+               tm = localtime((time_t *)&tv.tv_sec);
 #else
                tm = localtime(&tv.tv_sec);
 #endif
@@ -569,22 +569,22 @@ get_hostname(void)
                DWORD dw = last_error;
 
                FormatMessage(
-                       FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                       FORMAT_MESSAGE_FROM_SYSTEM |
-                       FORMAT_MESSAGE_IGNORE_INSERTS,
-                       NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                       (LPTSTR) &lpMsgBuf, 0, NULL);
+                 FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                 FORMAT_MESSAGE_FROM_SYSTEM |
+                 FORMAT_MESSAGE_IGNORE_INSERTS,
+                 NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                 (LPTSTR) &lpMsgBuf, 0, NULL);
 
                lpDisplayBuf = (LPVOID) LocalAlloc(
-                       LMEM_ZEROINIT,
-                       (lstrlen((LPCTSTR) lpMsgBuf) + lstrlen((LPCTSTR) __FILE__) + 200)
-                       * sizeof(TCHAR));
+                 LMEM_ZEROINIT,
+                 (lstrlen((LPCTSTR) lpMsgBuf) + lstrlen((LPCTSTR) __FILE__) + 200)
+                 * sizeof(TCHAR));
                _snprintf((LPTSTR) lpDisplayBuf,
                          LocalSize(lpDisplayBuf) / sizeof(TCHAR),
                          TEXT("%s failed with error %d: %s"), __FILE__, dw,
                          lpMsgBuf);
 
-               cc_log("can't get hostname OS returned error: %s", (char*)lpDisplayBuf);
+               cc_log("can't get hostname OS returned error: %s", (char *)lpDisplayBuf);
 
                LocalFree(lpMsgBuf);
                LocalFree(lpDisplayBuf);
@@ -634,10 +634,10 @@ format_hash_as_string(const unsigned char *hash, int size)
 }
 
 char const CACHEDIR_TAG[] =
-       "Signature: 8a477f597d28d172789f06886806bc55\n"
-       "# This file is a cache directory tag created by ccache.\n"
-       "# For information about cache directory tags, see:\n"
-       "#      http://www.brynosaurus.com/cachedir/\n";
+  "Signature: 8a477f597d28d172789f06886806bc55\n"
+  "# This file is a cache directory tag created by ccache.\n"
+  "# For information about cache directory tags, see:\n"
+  "#   http://www.brynosaurus.com/cachedir/\n";
 
 int
 create_cachedirtag(const char *dir)
@@ -690,9 +690,7 @@ format(const char *format, ...)
        return ptr;
 }
 
-/*
-  this is like strdup() but dies if the malloc fails
-*/
+/* This is like strdup() but dies if the malloc fails. */
 char *
 x_strdup(const char *s)
 {
@@ -704,9 +702,7 @@ x_strdup(const char *s)
        return ret;
 }
 
-/*
-  this is like strndup() but dies if the malloc fails
-*/
+/* This is like strndup() but dies if the malloc fails. */
 char *
 x_strndup(const char *s, size_t n)
 {
@@ -734,9 +730,7 @@ x_strndup(const char *s, size_t n)
        return ret;
 }
 
-/*
-  this is like malloc() but dies if the malloc fails
-*/
+/* This is like malloc() but dies if the malloc fails. */
 void *
 x_malloc(size_t size)
 {
@@ -774,9 +768,7 @@ x_calloc(size_t nmemb, size_t size)
        return ret;
 }
 
-/*
-  this is like realloc() but dies if the malloc fails
-*/
+/* This is like realloc() but dies if the malloc fails. */
 void *
 x_realloc(void *ptr, size_t size)
 {
@@ -1087,10 +1079,8 @@ parse_size_with_suffix(const char *str, uint64_t *size)
 }
 
 
-/*
-  a sane realpath() function, trying to cope with stupid path limits and
-  a broken API
-*/
+/* A sane realpath() function, trying to cope with stupid path limits and a
+ * broken API. */
 char *
 x_realpath(const char *path)
 {
@@ -1106,8 +1096,8 @@ x_realpath(const char *path)
        p = realpath(path, ret);
 #elif defined(_WIN32)
        path_handle = CreateFile(
-               path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
-               FILE_ATTRIBUTE_NORMAL, NULL);
+         path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+         FILE_ATTRIBUTE_NORMAL, NULL);
        if (INVALID_HANDLE_VALUE != path_handle) {
                GetFinalPathNameByHandle(path_handle, ret, maxlen, FILE_NAME_NORMALIZED);
                CloseHandle(path_handle);
@@ -1171,7 +1161,7 @@ strtok_r(char *str, const char *delim, char **saveptr)
        ret = strtok(str, delim);
        if (ret) {
                char *save = ret;
-               while (*save++);
+               while (*save++) ;
                if ((len + 1) == (intptr_t) (save - str))
                        save--;
                *saveptr = save;
@@ -1459,22 +1449,22 @@ x_rename(const char *oldpath, const char *newpath)
                DWORD dw = GetLastError();
 
                FormatMessage(
-                       FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                       FORMAT_MESSAGE_FROM_SYSTEM |
-                       FORMAT_MESSAGE_IGNORE_INSERTS,
-                       NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf,
-                       0, NULL);
+                 FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                 FORMAT_MESSAGE_FROM_SYSTEM |
+                 FORMAT_MESSAGE_IGNORE_INSERTS,
+                 NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf,
+                 0, NULL);
 
                lpDisplayBuf = (LPVOID) LocalAlloc(
-                       LMEM_ZEROINIT,
-                       (lstrlen((LPCTSTR) lpMsgBuf) + lstrlen((LPCTSTR) __FILE__) + 40)
-                       * sizeof(TCHAR));
+                 LMEM_ZEROINIT,
+                 (lstrlen((LPCTSTR) lpMsgBuf) + lstrlen((LPCTSTR) __FILE__) + 40)
+                 * sizeof(TCHAR));
                _snprintf((LPTSTR) lpDisplayBuf,
                          LocalSize(lpDisplayBuf) / sizeof(TCHAR),
                          TEXT("%s failed with error %d: %s"), __FILE__, dw, lpMsgBuf);
 
                cc_log("can't rename file %s to %s OS returned error: %s",
-                      oldpath, newpath, (char*) lpDisplayBuf);
+                      oldpath, newpath, (char *) lpDisplayBuf);
 
                LocalFree(lpMsgBuf);
                LocalFree(lpDisplayBuf);