mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-21 23:57:38 +00:00
Workaround GCC bug.
This commit is contained in:
parent
2001d3c617
commit
2bcdf27b03
@ -38,7 +38,7 @@ base::optional<BasicHeader> BinlogWrapper::ReadHeader(
|
||||
return {};
|
||||
} else if (binlog.read(bytes::object_as_span(&result)) != sizeof(result)) {
|
||||
return {};
|
||||
} else if (result.format != Format::Format_0) {
|
||||
} else if (result.getFormat() != Format::Format_0) {
|
||||
return {};
|
||||
} else if (settings.trackEstimatedTime
|
||||
!= !!(result.flags & result.kTrackEstimatedTime)) {
|
||||
|
@ -321,7 +321,7 @@ bool DatabaseObject::startDelayedPruning() {
|
||||
const auto seconds = int64(_minimalEntryTime - before);
|
||||
if (!_pruneTimer.isActive()) {
|
||||
_pruneTimer.callOnce(std::min(
|
||||
seconds * crl::time_type(1000),
|
||||
crl::time_type(seconds * 1000),
|
||||
_settings.maxPruneCheckTimeout));
|
||||
}
|
||||
}
|
||||
@ -963,8 +963,8 @@ QByteArray DatabaseObject::readValueData(PlaceId place, size_type size) const {
|
||||
}
|
||||
return result;
|
||||
} break;
|
||||
default: Unexpected("Result in DatabaseObject::get.");
|
||||
}
|
||||
Unexpected("Result in DatabaseObject::get.");
|
||||
}
|
||||
|
||||
void DatabaseObject::recordEntryAccess(const Key &key) {
|
||||
|
@ -88,7 +88,7 @@ bool WriteVersionValue(const QString &base, Version value) {
|
||||
}
|
||||
|
||||
BasicHeader::BasicHeader()
|
||||
: format(Format::Format_0)
|
||||
: format(static_cast<uint32>(Format::Format_0))
|
||||
, flags(0) {
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,14 @@ struct BasicHeader {
|
||||
|
||||
static constexpr auto kTrackEstimatedTime = 0x01U;
|
||||
|
||||
Format format : 8;
|
||||
Format getFormat() const {
|
||||
return static_cast<Format>(format);
|
||||
}
|
||||
void setFormat(Format format) {
|
||||
this->format = static_cast<uint32>(format);
|
||||
}
|
||||
|
||||
uint32 format : 8;
|
||||
uint32 flags : 24;
|
||||
uint32 systemTime = 0;
|
||||
uint32 reserved1 = 0;
|
||||
|
@ -21,8 +21,15 @@ enum class Format : uint32 {
|
||||
struct BasicHeader {
|
||||
BasicHeader();
|
||||
|
||||
void setFormat(Format format) {
|
||||
this->format = static_cast<uint32>(format);
|
||||
}
|
||||
Format getFormat() const {
|
||||
return static_cast<Format>(format);
|
||||
}
|
||||
|
||||
bytes::array<kSaltSize> salt = { { bytes::type() } };
|
||||
Format format : 8;
|
||||
uint32 format : 8;
|
||||
uint32 reserved1 : 24;
|
||||
uint32 reserved2 = 0;
|
||||
uint64 applicationVersion = 0;
|
||||
@ -30,7 +37,7 @@ struct BasicHeader {
|
||||
};
|
||||
|
||||
BasicHeader::BasicHeader()
|
||||
: format(Format::Format_0)
|
||||
: format(static_cast<uint32>(Format::Format_0))
|
||||
, reserved1(0) {
|
||||
}
|
||||
|
||||
@ -150,7 +157,7 @@ File::Result File::readHeader(const EncryptionKey &key) {
|
||||
headerBytes.subspan(0, checkSize));
|
||||
if (bytes::compare(header.checksum, checksum) != 0) {
|
||||
return Result::WrongKey;
|
||||
} else if (header.format != Format::Format_0) {
|
||||
} else if (header.getFormat() != Format::Format_0) {
|
||||
return Result::Failed;
|
||||
}
|
||||
_dataSize = _data.size()
|
||||
|
Loading…
Reference in New Issue
Block a user