Fix clang compilation error

- Non-const lvalue reference can’t bind to temporary object. Makes
sense, but compiles by MSVC.
This commit is contained in:
Nikolaj Schlej 2016-02-02 02:21:55 +01:00
parent 4cf6b4f37b
commit 645b50538a
2 changed files with 4 additions and 4 deletions

View File

@ -2319,12 +2319,12 @@ STATUS FfsParser::parseGuidedSectionBody(const QModelIndex & index)
// Check if section requires processing // Check if section requires processing
QByteArray processed = model->body(index); QByteArray processed = model->body(index);
QByteArray efiDecompressed;
QString info; QString info;
bool parseCurrentSection = true; bool parseCurrentSection = true;
UINT8 algorithm = COMPRESSION_ALGORITHM_NONE; UINT8 algorithm = COMPRESSION_ALGORITHM_NONE;
// Tiano compressed section // Tiano compressed section
if (QByteArray((const char*)&guid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_TIANO) { if (QByteArray((const char*)&guid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_TIANO) {
QByteArray efiDecompressed;
algorithm = EFI_STANDARD_COMPRESSION; algorithm = EFI_STANDARD_COMPRESSION;
STATUS result = decompress(model->body(index), algorithm, processed, efiDecompressed); STATUS result = decompress(model->body(index), algorithm, processed, efiDecompressed);
if (result) { if (result) {
@ -2355,7 +2355,7 @@ STATUS FfsParser::parseGuidedSectionBody(const QModelIndex & index)
// LZMA compressed section // LZMA compressed section
else if (QByteArray((const char*)&guid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_LZMA) { else if (QByteArray((const char*)&guid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_LZMA) {
algorithm = EFI_CUSTOMIZED_COMPRESSION; algorithm = EFI_CUSTOMIZED_COMPRESSION;
STATUS result = decompress(model->body(index), algorithm, processed); STATUS result = decompress(model->body(index), algorithm, processed, efiDecompressed);
if (result) { if (result) {
parseCurrentSection = false; parseCurrentSection = false;
msg(tr("parseGuidedSectionBody: decompression failed with error \"%1\"").arg(errorCodeToQString(result)), index); msg(tr("parseGuidedSectionBody: decompression failed with error \"%1\"").arg(errorCodeToQString(result)), index);

View File

@ -29,7 +29,7 @@ QByteArray parsingDataToQByteArray(const PARSING_DATA & pdata);
extern QString errorCodeToQString(UINT8 errorCode); extern QString errorCodeToQString(UINT8 errorCode);
// Decompression routine // Decompression routine
extern STATUS decompress(const QByteArray & compressed, UINT8 & algorithm, QByteArray & decompressed, QByteArray & efiDecompressed = QByteArray()); extern STATUS decompress(const QByteArray & compressed, UINT8 & algorithm, QByteArray & decompressed, QByteArray & efiDecompressed);
// Compression routine // Compression routine
//STATUS compress(const QByteArray & decompressed, QByteArray & compressed, const UINT8 & algorithm); //STATUS compress(const QByteArray & decompressed, QByteArray & compressed, const UINT8 & algorithm);
@ -43,4 +43,4 @@ extern UINT8 calculateChecksum8(const UINT8* buffer, UINT32 bufferSize);
// 16bit checksum calculation routine // 16bit checksum calculation routine
extern UINT16 calculateChecksum16(const UINT16* buffer, UINT32 bufferSize); extern UINT16 calculateChecksum16(const UINT16* buffer, UINT32 bufferSize);
#endif #endif