GCC/Clang compatibility

- and some menu fixes
This commit is contained in:
Nikolaj Schlej 2016-03-01 09:52:25 +01:00
parent f729dd58b7
commit 867f507fac
4 changed files with 19 additions and 12 deletions

View File

@ -151,6 +151,8 @@ void UEFITool::init()
connect(ui->finderMessagesListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyActions(QListWidgetItem*))); connect(ui->finderMessagesListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyActions(QListWidgetItem*)));
connect(ui->fitMessagesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(scrollTreeView(QListWidgetItem*))); connect(ui->fitMessagesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(scrollTreeView(QListWidgetItem*)));
connect(ui->fitMessagesListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyActions(QListWidgetItem*))); connect(ui->fitMessagesListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyActions(QListWidgetItem*)));
connect(ui->builderMessagesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(scrollTreeView(QListWidgetItem*)));
connect(ui->builderMessagesListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyActions(QListWidgetItem*)));
} }
void UEFITool::populateUi(const QModelIndex &current) void UEFITool::populateUi(const QModelIndex &current)
@ -852,7 +854,10 @@ void UEFITool::scrollTreeView(QListWidgetItem* item)
void UEFITool::contextMenuEvent(QContextMenuEvent* event) void UEFITool::contextMenuEvent(QContextMenuEvent* event)
{ {
if (ui->parserMessagesListWidget->underMouse() || ui->finderMessagesListWidget->underMouse()) { if (ui->parserMessagesListWidget->underMouse() ||
ui->fitMessagesListWidget->underMouse() ||
ui->finderMessagesListWidget->underMouse() ||
ui->builderMessagesListWidget->underMouse()) {
ui->menuMessages->exec(event->globalPos()); ui->menuMessages->exec(event->globalPos());
return; return;
} }

View File

@ -13,7 +13,8 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <QObject> #include <QObject>
#include "ffs.h" #include "ffs.h"
const std::vector<QByteArray> FFSv2Volumes({ // This is a workaround for the lack of static std::vector initializer before C++11
const QByteArray FFSv2VolumesInt[] = {
EFI_FIRMWARE_FILE_SYSTEM_GUID, EFI_FIRMWARE_FILE_SYSTEM_GUID,
EFI_FIRMWARE_FILE_SYSTEM2_GUID, EFI_FIRMWARE_FILE_SYSTEM2_GUID,
EFI_APPLE_BOOT_VOLUME_FILE_SYSTEM_GUID, EFI_APPLE_BOOT_VOLUME_FILE_SYSTEM_GUID,
@ -21,11 +22,12 @@ const std::vector<QByteArray> FFSv2Volumes({
EFI_INTEL_FILE_SYSTEM_GUID, EFI_INTEL_FILE_SYSTEM_GUID,
EFI_INTEL_FILE_SYSTEM2_GUID, EFI_INTEL_FILE_SYSTEM2_GUID,
EFI_SONY_FILE_SYSTEM_GUID EFI_SONY_FILE_SYSTEM_GUID
}); };
// This number must be updated if the array above is grown
const std::vector<QByteArray> FFSv3Volumes({ #define FFSv2VolumesIntSize 7
EFI_FIRMWARE_FILE_SYSTEM3_GUID const std::vector<QByteArray> FFSv2Volumes(FFSv2VolumesInt, FFSv2VolumesInt + FFSv2VolumesIntSize);
}); // Luckily, FFSv3Volumes now only has 1 element
const std::vector<QByteArray> FFSv3Volumes(1, EFI_FIRMWARE_FILE_SYSTEM3_GUID);
const UINT8 ffsAlignmentTable[] = const UINT8 ffsAlignmentTable[] =
{ 0, 4, 7, 9, 10, 12, 15, 16 }; { 0, 4, 7, 9, 10, 12, 15, 16 };

View File

@ -102,7 +102,7 @@ STATUS FfsBuilder::buildCapsule(const QModelIndex & index, QByteArray & capsule)
// Check image type // Check image type
if (model->type(imageIndex) == Types::Image) { if (model->type(imageIndex) == Types::Image) {
STATUS result; STATUS result = ERR_SUCCESS;
if (model->subtype(imageIndex) == Subtypes::IntelImage) { if (model->subtype(imageIndex) == Subtypes::IntelImage) {
result = buildIntelImage(imageIndex, imageData); result = buildIntelImage(imageIndex, imageData);
} }

View File

@ -438,7 +438,7 @@ STATUS FfsParser::parseIntelImage(const QByteArray & intelImage, const UINT32 pa
region.length = regions.front().offset - FLASH_DESCRIPTOR_SIZE; region.length = regions.front().offset - FLASH_DESCRIPTOR_SIZE;
region.data = intelImage.mid(region.offset, region.length); region.data = intelImage.mid(region.offset, region.length);
region.type = getPaddingType(region.data); region.type = getPaddingType(region.data);
regions.insert(regions.cbegin(), region); regions.insert(regions.begin(), region);
} }
// Check for intersections/paddings between regions // Check for intersections/paddings between regions
for (size_t i = 1; i < regions.size(); i++) { for (size_t i = 1; i < regions.size(); i++) {
@ -463,9 +463,9 @@ STATUS FfsParser::parseIntelImage(const QByteArray & intelImage, const UINT32 pa
region.length = regions[i].offset - previousRegionEnd; region.length = regions[i].offset - previousRegionEnd;
region.data = intelImage.mid(region.offset, region.length); region.data = intelImage.mid(region.offset, region.length);
region.type = getPaddingType(region.data); region.type = getPaddingType(region.data);
std::vector<REGION_INFO>::const_iterator citer = regions.begin(); std::vector<REGION_INFO>::iterator iter = regions.begin();
std::advance(citer, i - 1); std::advance(iter, i - 1);
regions.insert(citer, region); regions.insert(iter, region);
} }
} }
// Check for padding after the last region // Check for padding after the last region