]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Reduce scope of result variables
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 14 Jul 2012 19:36:02 +0000 (21:36 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 14 Jul 2012 19:36:02 +0000 (21:36 +0200)
ccache.c
hashutil.c

index 692b222c3f980a46963206f9ab52bada77aab9a8..01a73829f4417e874f109e145fe13e5ded5ada89 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -317,7 +317,6 @@ remember_include_file(char *path, struct mdfour *cpp_hash)
        struct stat st;
        char *source = NULL;
        size_t size;
-       int result;
        bool is_pch;
        size_t path_len = strlen(path);
 
@@ -382,6 +381,8 @@ remember_include_file(char *path, struct mdfour *cpp_hash)
                struct file_hash *h;
 
                if (!is_pch) { /* else: the file has already been hashed. */
+                       int result;
+
                        if (st.st_size > 0) {
                                if (!read_file(path, st.st_size, &source, &size)) {
                                        goto failure;
index 45344741b9155c631334f917d9359401d3c212bd..a15f2511421ae8445ad07d8703bfad459a0082b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2011 Joel Rosdahl
+ * Copyright (C) 2009-2012 Joel Rosdahl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -159,7 +159,6 @@ hash_source_code_file(struct conf *conf, struct mdfour *hash, const char *path)
 {
        char *data;
        size_t size;
-       int result;
 
        if (is_precompiled_header(path)) {
                if (hash_file(hash, path)) {
@@ -168,6 +167,8 @@ hash_source_code_file(struct conf *conf, struct mdfour *hash, const char *path)
                        return HASH_SOURCE_CODE_ERROR;
                }
        } else {
+               int result;
+
                if (!read_file(path, 0, &data, &size)) {
                        return HASH_SOURCE_CODE_ERROR;
                }