Reduce scope of result variables

This commit is contained in:
Joel Rosdahl 2012-07-14 21:36:02 +02:00
parent 97a0ebcc3f
commit f94c080034
2 changed files with 5 additions and 3 deletions

View File

@ -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;

View 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;
}