diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2018-11-21 13:07:50 +0100 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2018-11-23 05:08:30 +0000 |
commit | bbf1df76a6eddbb91a425be9afda1cbf8a903a8d (patch) | |
tree | aebd29fe2fe042939fc5e9edd7e4f7f08e41b3ec /util/cbfstool | |
parent | deed1e3c630ba0a87691e5d0539e51a1b42534b5 (diff) |
util/cbfstool: Fix GCC error due to a shadowed declaration
There is already a function with the name buffer_size(). Adding a local
variable with the same name will lead to the following error on older
GCC versions (e.g. version 4.4.7):
declaration of 'buffer_size' shadows a global declaration
To fix this rename the local variable to buffer_len.
Change-Id: Ifae3a17152f2f9852d29a4ac038f7e5a75a41614
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/29776
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Joel Kitching <kitching@google.com>
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Diffstat (limited to 'util/cbfstool')
-rw-r--r-- | util/cbfstool/cbfs_image.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 3c5d29cbea..6ccc4f904e 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -1299,7 +1299,7 @@ int cbfs_export_entry(struct cbfs_image *image, const char *entry_name, unsigned int decompressed_size = 0; unsigned int compression = cbfs_file_get_compression_info(entry, &decompressed_size); - unsigned int buffer_size; + unsigned int buffer_len; decomp_func_ptr decompress; if (do_processing) { @@ -1308,11 +1308,11 @@ int cbfs_export_entry(struct cbfs_image *image, const char *entry_name, ERROR("looking up decompression routine failed\n"); return -1; } - buffer_size = decompressed_size; + buffer_len = decompressed_size; } else { /* Force nop decompression */ decompress = decompression_function(CBFS_COMPRESS_NONE); - buffer_size = compressed_size; + buffer_len = compressed_size; } LOG("Found file %.30s at 0x%x, type %.12s, compressed %d, size %d\n", @@ -1321,8 +1321,8 @@ int cbfs_export_entry(struct cbfs_image *image, const char *entry_name, decompressed_size); buffer_init(&buffer, strdup("(cbfs_export_entry)"), NULL, 0); - buffer.data = malloc(buffer_size); - buffer.size = buffer_size; + buffer.data = malloc(buffer_len); + buffer.size = buffer_len; if (decompress(CBFS_SUBHEADER(entry), compressed_size, buffer.data, buffer.size, NULL)) { |