diff --git a/src/system/boot/platform/efi/video.cpp b/src/system/boot/platform/efi/video.cpp index aa96c96d56..3399c3b117 100644 --- a/src/system/boot/platform/efi/video.cpp +++ b/src/system/boot/platform/efi/video.cpp @@ -84,7 +84,7 @@ static video_mode* closest_video_mode(uint32 width, uint32 height, uint32 depth) { video_mode *bestMode = NULL; - uint32 bestDiff = 0; + int64 bestDiff = 0; video_mode *mode = NULL; while ((mode = (video_mode*)list_get_next_item(&sModeList, mode)) != NULL) { @@ -94,8 +94,9 @@ closest_video_mode(uint32 width, uint32 height, uint32 depth) continue; } - uint32 diff = 2 * abs(mode->width - width) + abs(mode->height - height) - + abs(mode->bits_per_pixel - depth); + int64 diff = 2 * abs((int64)mode->width - width) + + abs((int64)mode->height - height) + + abs((int64)mode->bits_per_pixel - depth); if (bestMode == NULL || bestDiff > diff) { bestMode = mode; diff --git a/src/system/libroot/posix/string/arch/x86_64/arch_string.cpp b/src/system/libroot/posix/string/arch/x86_64/arch_string.cpp index 8639327b20..8d33b7ceb5 100644 --- a/src/system/libroot/posix/string/arch/x86_64/arch_string.cpp +++ b/src/system/libroot/posix/string/arch/x86_64/arch_string.cpp @@ -15,6 +15,15 @@ namespace { +// __m128i resolves to a type with an attribute, which can't get into the +// template signature, resulting in a warning. Nonetheless the code is what we +// expect, so we silent the warning. +#pragma GCC diagnostic push +#if defined __GNUC__ && __GNUC__ >= 6 +#pragma GCC diagnostic ignored "-Wignored-attributes" +#endif + + template class Generator, unsigned N, unsigned ...Index> struct GenerateTable : GenerateTable { }; @@ -32,6 +41,9 @@ struct GenerateTable }; +#pragma GCC diagnostic pop + + static inline void memcpy_repmovs(uint8_t* destination, const uint8_t* source, size_t length) {