efi: fix loader build.

This commit is contained in:
Jérôme Duval
2018-06-03 18:14:32 +02:00
parent 379d232693
commit 8088f452ff
2 changed files with 16 additions and 3 deletions
+4 -3
View File
@@ -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;
@@ -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<template<size_t N> class Generator, unsigned N, unsigned ...Index>
struct GenerateTable : GenerateTable<Generator, N - 1, N - 1, Index...> {
};
@@ -32,6 +41,9 @@ struct GenerateTable<Generator, 0, Index...>
};
#pragma GCC diagnostic pop
static inline void memcpy_repmovs(uint8_t* destination, const uint8_t* source,
size_t length)
{