mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
GCC/Clang compatibility
- and some menu fixes
This commit is contained in:
parent
f729dd58b7
commit
867f507fac
@ -151,6 +151,8 @@ void UEFITool::init()
|
||||
connect(ui->finderMessagesListWidget, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(enableMessagesCopyActions(QListWidgetItem*)));
|
||||
connect(ui->fitMessagesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(scrollTreeView(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 ¤t)
|
||||
@ -852,7 +854,10 @@ void UEFITool::scrollTreeView(QListWidgetItem* item)
|
||||
|
||||
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());
|
||||
return;
|
||||
}
|
||||
|
@ -13,7 +13,8 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <QObject>
|
||||
#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_SYSTEM2_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_SYSTEM2_GUID,
|
||||
EFI_SONY_FILE_SYSTEM_GUID
|
||||
});
|
||||
|
||||
const std::vector<QByteArray> FFSv3Volumes({
|
||||
EFI_FIRMWARE_FILE_SYSTEM3_GUID
|
||||
});
|
||||
};
|
||||
// This number must be updated if the array above is grown
|
||||
#define FFSv2VolumesIntSize 7
|
||||
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[] =
|
||||
{ 0, 4, 7, 9, 10, 12, 15, 16 };
|
||||
|
@ -102,7 +102,7 @@ STATUS FfsBuilder::buildCapsule(const QModelIndex & index, QByteArray & capsule)
|
||||
|
||||
// Check image type
|
||||
if (model->type(imageIndex) == Types::Image) {
|
||||
STATUS result;
|
||||
STATUS result = ERR_SUCCESS;
|
||||
if (model->subtype(imageIndex) == Subtypes::IntelImage) {
|
||||
result = buildIntelImage(imageIndex, imageData);
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ STATUS FfsParser::parseIntelImage(const QByteArray & intelImage, const UINT32 pa
|
||||
region.length = regions.front().offset - FLASH_DESCRIPTOR_SIZE;
|
||||
region.data = intelImage.mid(region.offset, region.length);
|
||||
region.type = getPaddingType(region.data);
|
||||
regions.insert(regions.cbegin(), region);
|
||||
regions.insert(regions.begin(), region);
|
||||
}
|
||||
// Check for intersections/paddings between regions
|
||||
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.data = intelImage.mid(region.offset, region.length);
|
||||
region.type = getPaddingType(region.data);
|
||||
std::vector<REGION_INFO>::const_iterator citer = regions.begin();
|
||||
std::advance(citer, i - 1);
|
||||
regions.insert(citer, region);
|
||||
std::vector<REGION_INFO>::iterator iter = regions.begin();
|
||||
std::advance(iter, i - 1);
|
||||
regions.insert(iter, region);
|
||||
}
|
||||
}
|
||||
// Check for padding after the last region
|
||||
|
Loading…
Reference in New Issue
Block a user