зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1849074 - Use std::vector<unsigned char> instead of std::basic_string<unsigned char>. r=media-playback-reviewers,padenot
std::basic_string<unsigned char> is not guaranteed to exist by the standard, and is actively being removed from libc++ in LLVM 18. This instead uses std::vector<unsigned char>. Differential Revision: https://phabricator.services.mozilla.com/D186419
This commit is contained in:
Родитель
b391a46e6b
Коммит
6a4c2ed466
|
@ -50,7 +50,7 @@ bool GetMachineIdImpl(const std::vector<uint8_t>& sid_bytes,
|
|||
|
||||
// The ID should be the SID hash + the Hard Drive SNo. + checksum byte.
|
||||
static const int kSizeWithoutChecksum = mozilla::SHA1Sum::kHashSize + sizeof(int);
|
||||
std::basic_string<unsigned char> id_binary(kSizeWithoutChecksum + 1, 0);
|
||||
std::vector<unsigned char> id_binary(kSizeWithoutChecksum + 1, 0);
|
||||
|
||||
if (!sid_bytes.empty()) {
|
||||
// In order to be compatible with the old version of RLZ, the hash of the
|
||||
|
@ -80,12 +80,12 @@ bool GetMachineIdImpl(const std::vector<uint8_t>& sid_bytes,
|
|||
|
||||
// Append the checksum byte.
|
||||
if (!sid_bytes.empty() || (0 != volume_id))
|
||||
rlz_lib::Crc8::Generate(id_binary.c_str(),
|
||||
rlz_lib::Crc8::Generate(id_binary.data(),
|
||||
kSizeWithoutChecksum,
|
||||
&id_binary[kSizeWithoutChecksum]);
|
||||
|
||||
return rlz_lib::BytesToString(
|
||||
id_binary.c_str(), kSizeWithoutChecksum + 1, machine_id);
|
||||
id_binary.data(), kSizeWithoutChecksum + 1, machine_id);
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
|
|
Загрузка…
Ссылка в новой задаче