mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-26 23:01:05 +08:00
minidump: Use decltype(object) instead of typeof(object).
TEST=minidump_test R=rsesek@chromium.org Review URL: https://codereview.chromium.org/681313005
This commit is contained in:
parent
765e428321
commit
78bec65b27
@ -76,7 +76,7 @@ bool MinidumpMemoryWriter::WillWriteAtOffsetImpl(off_t offset) {
|
||||
DCHECK_GE(registered_memory_descriptors_.size(), 1u);
|
||||
|
||||
uint64_t base_address = MemoryRangeBaseAddress();
|
||||
typeof(registered_memory_descriptors_[0]->StartOfMemoryRange) local_address;
|
||||
decltype(registered_memory_descriptors_[0]->StartOfMemoryRange) local_address;
|
||||
if (!AssignIfInRange(&local_address, base_address)) {
|
||||
LOG(ERROR) << "base_address " << base_address << " out of range";
|
||||
return false;
|
||||
|
@ -47,7 +47,7 @@ MinidumpModuleCodeViewRecordPDBLinkWriter<CodeViewRecordType>::SizeOfObject() {
|
||||
DCHECK_GE(state(), kStateFrozen);
|
||||
|
||||
// NUL-terminate.
|
||||
return offsetof(typeof(codeview_record_), pdb_name) +
|
||||
return offsetof(decltype(codeview_record_), pdb_name) +
|
||||
(pdb_name_.size() + 1) * sizeof(pdb_name_[0]);
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ bool MinidumpModuleCodeViewRecordPDBLinkWriter<CodeViewRecordType>::WriteObject(
|
||||
|
||||
WritableIoVec iov;
|
||||
iov.iov_base = &codeview_record_;
|
||||
iov.iov_len = offsetof(typeof(codeview_record_), pdb_name);
|
||||
iov.iov_len = offsetof(decltype(codeview_record_), pdb_name);
|
||||
std::vector<WritableIoVec> iovecs(1, iov);
|
||||
|
||||
// NUL-terminate.
|
||||
@ -131,12 +131,12 @@ bool MinidumpModuleMiscDebugRecordWriter::Freeze() {
|
||||
// NUL-terminate.
|
||||
if (!image_debug_misc_.Unicode) {
|
||||
DCHECK(data_utf16_.empty());
|
||||
image_debug_misc_.Length = offsetof(typeof(image_debug_misc_), Data) +
|
||||
image_debug_misc_.Length = offsetof(decltype(image_debug_misc_), Data) +
|
||||
(data_.size() + 1) * sizeof(data_[0]);
|
||||
} else {
|
||||
DCHECK(data_.empty());
|
||||
image_debug_misc_.Length =
|
||||
offsetof(typeof(image_debug_misc_), Data) +
|
||||
offsetof(decltype(image_debug_misc_), Data) +
|
||||
(data_utf16_.size() + 1) * sizeof(data_utf16_[0]);
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ bool MinidumpModuleMiscDebugRecordWriter::WriteObject(
|
||||
FileWriterInterface* file_writer) {
|
||||
DCHECK_EQ(state(), kStateWritable);
|
||||
|
||||
const size_t base_length = offsetof(typeof(image_debug_misc_), Data);
|
||||
const size_t base_length = offsetof(decltype(image_debug_misc_), Data);
|
||||
|
||||
WritableIoVec iov;
|
||||
iov.iov_base = &image_debug_misc_;
|
||||
|
@ -180,7 +180,7 @@ size_t MinidumpWritable::WillWriteAtOffset(
|
||||
}
|
||||
|
||||
if (!registered_location_descriptors_.empty()) {
|
||||
typeof(registered_location_descriptors_[0]->DataSize) local_size;
|
||||
decltype(registered_location_descriptors_[0]->DataSize) local_size;
|
||||
if (!AssignIfInRange(&local_size, size)) {
|
||||
LOG(ERROR) << "size " << size << " out of range";
|
||||
return kInvalidSize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user