bmpblk_utility: fix build warnings (errors) with USE="-minimal"
authorBrian Norris <briannorris@chromium.org>
Fri, 22 Jul 2016 17:17:56 +0000 (10:17 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Tue, 26 Jul 2016 04:01:46 +0000 (21:01 -0700)
commitc61df529d073ee2440d3b80c0a58a85a92d98e8f
treec0b4dea397c4a8072646f6ff403c9937ebad30b2
parent1d4c49b94fb426e429312582188b4858f6b241e8
bmpblk_utility: fix build warnings (errors) with USE="-minimal"

Warning like this:

utility/bmpblk_utility.cc: In member function 'void vboot_reference::BmpBlockUtil::load_yaml_config(const char*)':
utility/bmpblk_utility.cc:104:61: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'std::vector<std::basic_string<char> >::size_type {aka unsigned int}' [-Werror=format=]
       printf("%ld image_names\n", config_.image_names.size());
                                                             ^
utility/bmpblk_utility.cc:108:59: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'std::map<std::basic_string<char>, vboot_reference::ImageConfig>::size_type {aka unsigned int}' [-Werror=format=]
       printf("%ld images_map\n", config_.images_map.size());
                                                           ^
utility/bmpblk_utility.cc:119:61: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'std::map<std::basic_string<char>, vboot_reference::ScreenConfig>::size_type {aka unsigned int}' [-Werror=format=]
       printf("%ld screens_map\n", config_.screens_map.size());
                                                             ^
utility/bmpblk_utility.cc: In member function 'void vboot_reference::BmpBlockUtil::pack_bmpblock()':
utility/bmpblk_utility.cc:597:70: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'std::basic_string<char>::size_type {aka unsigned int}' [-Werror=format=]
                current_offset, it->second.compressed_content.length());
                                                                      ^
utility/bmpblk_utility.cc:609:59: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'std::basic_string<char>::size_type {aka unsigned int}' [-Werror=format=]
                current_offset, config_.locale_names.size());
                                                           ^

Technically, C++ container::size_type is slightly different than size_t, but I
think %zd should work fine.

BRANCH=none
BUG=none
TEST=`USE="-minimal" emerge-kevin vboot_reference`

Change-Id: I9d0b22818714cad2ad7e95557df7837c91c2b0f7
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/362621
Reviewed-by: Randall Spangler <rspangler@chromium.org>
utility/bmpblk_utility.cc