[coreboot-gerrit] Change in ...coreboot[master]: util/cbfstool: Fix GCC error due to a shadowed declaration
Werner Zeh (Code Review)
gerrit at coreboot.org
Fri Nov 23 06:08:34 CET 2018
Werner Zeh has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/29776 )
Change subject: util/cbfstool: Fix GCC error due to a shadowed declaration
......................................................................
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 at siemens.com>
Reviewed-on: https://review.coreboot.org/c/29776
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Joel Kitching <kitching at google.com>
Reviewed-by: Mario Scheithauer <mario.scheithauer at siemens.com>
---
M util/cbfstool/cbfs_image.c
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
build bot (Jenkins): Verified
Mario Scheithauer: Looks good to me, approved
Joel Kitching: Looks good to me, approved
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 3c5d29c..6ccc4f9 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -1299,7 +1299,7 @@
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 @@
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 @@
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)) {
--
To view, visit https://review.coreboot.org/c/coreboot/+/29776
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifae3a17152f2f9852d29a4ac038f7e5a75a41614
Gerrit-Change-Number: 29776
Gerrit-PatchSet: 3
Gerrit-Owner: Werner Zeh <werner.zeh at siemens.com>
Gerrit-Reviewer: Joel Kitching <kitching at google.com>
Gerrit-Reviewer: Mario Scheithauer <mario.scheithauer at siemens.com>
Gerrit-Reviewer: Werner Zeh <werner.zeh at siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181123/93c6ff0c/attachment.html>
More information about the coreboot-gerrit
mailing list