mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Address /W4 compiler warnings for Windows (#4910)
This commit is contained in:
parent
cb90a8356b
commit
186f4289e9
50 changed files with 279 additions and 272 deletions
|
|
@ -349,8 +349,8 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet,
|
|||
|
||||
// split cards are considered a single card, enqueue for later merging
|
||||
if (layout == "split" || layout == "aftermath" || layout == "adventure") {
|
||||
auto faceName = getStringPropertyFromMap(card, "faceName");
|
||||
SplitCardPart split(faceName, text, properties, setInfo);
|
||||
auto _faceName = getStringPropertyFromMap(card, "faceName");
|
||||
SplitCardPart split(_faceName, text, properties, setInfo);
|
||||
auto found_iter = splitCards.find(name);
|
||||
if (found_iter == splitCards.end()) {
|
||||
splitCards.insert(name, {split});
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ void LoadSetsPage::actDownloadFinishedSetsFile()
|
|||
reply->deleteLater();
|
||||
}
|
||||
|
||||
void LoadSetsPage::readSetsFromByteArray(QByteArray data)
|
||||
void LoadSetsPage::readSetsFromByteArray(QByteArray _data)
|
||||
{
|
||||
// show an infinite progressbar
|
||||
progressBar->setMaximum(0);
|
||||
|
|
@ -450,16 +450,16 @@ void LoadSetsPage::readSetsFromByteArray(QByteArray data)
|
|||
|
||||
wizard()->downloadedPlainXml = false;
|
||||
wizard()->xmlData.clear();
|
||||
readSetsFromByteArrayRef(data);
|
||||
readSetsFromByteArrayRef(_data);
|
||||
}
|
||||
|
||||
void LoadSetsPage::readSetsFromByteArrayRef(QByteArray &data)
|
||||
void LoadSetsPage::readSetsFromByteArrayRef(QByteArray &_data)
|
||||
{
|
||||
// unzip the file if needed
|
||||
if (data.startsWith(XZ_SIGNATURE)) {
|
||||
if (_data.startsWith(XZ_SIGNATURE)) {
|
||||
#ifdef HAS_LZMA
|
||||
// zipped file
|
||||
auto *inBuffer = new QBuffer(&data);
|
||||
auto *inBuffer = new QBuffer(&_data);
|
||||
auto newData = QByteArray();
|
||||
auto *outBuffer = new QBuffer(&newData);
|
||||
inBuffer->open(QBuffer::ReadOnly);
|
||||
|
|
@ -469,7 +469,7 @@ void LoadSetsPage::readSetsFromByteArrayRef(QByteArray &data)
|
|||
zipDownloadFailed(tr("Xz extraction failed."));
|
||||
return;
|
||||
}
|
||||
data.clear();
|
||||
_data.clear();
|
||||
readSetsFromByteArrayRef(newData);
|
||||
return;
|
||||
#else
|
||||
|
|
@ -481,10 +481,10 @@ void LoadSetsPage::readSetsFromByteArrayRef(QByteArray &data)
|
|||
progressBar->hide();
|
||||
return;
|
||||
#endif
|
||||
} else if (data.startsWith(ZIP_SIGNATURE)) {
|
||||
} else if (_data.startsWith(ZIP_SIGNATURE)) {
|
||||
#ifdef HAS_ZLIB
|
||||
// zipped file
|
||||
auto *inBuffer = new QBuffer(&data);
|
||||
auto *inBuffer = new QBuffer(&_data);
|
||||
auto newData = QByteArray();
|
||||
auto *outBuffer = new QBuffer(&newData);
|
||||
QString fileName;
|
||||
|
|
@ -510,7 +510,7 @@ void LoadSetsPage::readSetsFromByteArrayRef(QByteArray &data)
|
|||
uz.closeArchive();
|
||||
return;
|
||||
}
|
||||
data.clear();
|
||||
_data.clear();
|
||||
readSetsFromByteArrayRef(newData);
|
||||
return;
|
||||
#else
|
||||
|
|
@ -522,15 +522,15 @@ void LoadSetsPage::readSetsFromByteArrayRef(QByteArray &data)
|
|||
progressBar->hide();
|
||||
return;
|
||||
#endif
|
||||
} else if (data.startsWith("{")) {
|
||||
} else if (_data.startsWith("{")) {
|
||||
// Start the computation.
|
||||
jsonData = std::move(data);
|
||||
jsonData = std::move(_data);
|
||||
future = QtConcurrent::run([this] { return wizard()->importer->readSetsFromByteArray(std::move(jsonData)); });
|
||||
watcher.setFuture(future);
|
||||
} else if (data.startsWith("<")) {
|
||||
} else if (_data.startsWith("<")) {
|
||||
// save xml file and don't do any processing
|
||||
wizard()->downloadedPlainXml = true;
|
||||
wizard()->xmlData = std::move(data);
|
||||
wizard()->xmlData = std::move(_data);
|
||||
importFinished();
|
||||
} else {
|
||||
wizard()->enableButtons();
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ public:
|
|||
protected:
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
void readSetsFromByteArray(QByteArray data);
|
||||
void readSetsFromByteArrayRef(QByteArray &data);
|
||||
void readSetsFromByteArray(QByteArray _data);
|
||||
void readSetsFromByteArrayRef(QByteArray &_data);
|
||||
void downloadSetsFile(const QUrl &url);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -1012,9 +1012,9 @@ void UnzipPrivate::initKeys(const QString& pwd, quint32* keys) const
|
|||
The \p file parameter can be used in the user interface or for debugging purposes
|
||||
as it is the name of the encrypted file for wich the password is being tested.
|
||||
*/
|
||||
UnZip::ErrorCode UnzipPrivate::testPassword(quint32* keys, const QString& file, const ZipEntryP& header)
|
||||
UnZip::ErrorCode UnzipPrivate::testPassword(quint32* keys, const QString&_file, const ZipEntryP& header)
|
||||
{
|
||||
Q_UNUSED(file);
|
||||
Q_UNUSED(_file);
|
||||
Q_ASSERT(device);
|
||||
|
||||
// read encryption keys
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public:
|
|||
UnZip::ErrorCode extractFile(const QString& path, const ZipEntryP& entry, const QDir& dir, UnZip::ExtractionOptions options);
|
||||
UnZip::ErrorCode extractFile(const QString& path, const ZipEntryP& entry, QIODevice* device, UnZip::ExtractionOptions options);
|
||||
|
||||
UnZip::ErrorCode testPassword(quint32* keys, const QString& file, const ZipEntryP& header);
|
||||
UnZip::ErrorCode testPassword(quint32* keys, const QString&_file, const ZipEntryP& header);
|
||||
bool testKeys(const ZipEntryP& header, quint32* keys);
|
||||
|
||||
bool createDirectory(const QString& path);
|
||||
|
|
|
|||
|
|
@ -95,8 +95,6 @@ int OSDAB_ZIP_MANGLE(currentUtcOffset)()
|
|||
const int utcOffset = -qRound(difftime(global_time_t, local_time_t));
|
||||
return tm_struct->tm_isdst > 0 ? utcOffset + 3600 : utcOffset;
|
||||
#endif // No UTC
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QDateTime OSDAB_ZIP_MANGLE(fromFileTimestamp)(const QDateTime &dateTime)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue