mirror of
https://github.com/reactos/ccache.git
synced 2024-10-06 16:43:26 +00:00
Reduce scope of result variables
This commit is contained in:
parent
97a0ebcc3f
commit
f94c080034
3
ccache.c
3
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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user