mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-26 06:31:50 +08:00
Fix some accidental uses of argument-dependent lookup
StringToInt(string_piece) works because base::StringPiece is in namespace base, but when it is switched to std::string_view, this won't work anymore. Use the idiomatic spelling. Bug: chromium:691162 Change-Id: Ic45e0d2729fa5fc7c3e7a56fe159957b1bdcdf94 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4298113 Commit-Queue: David Benjamin <davidben@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
parent
9830fbf3b4
commit
90bba04e22
@ -315,7 +315,7 @@ class RingBufferAnnotationSnapshot final {
|
||||
int next_value;
|
||||
base::StringPiece str(reinterpret_cast<const char*>(&bytes[0]),
|
||||
bytes.size());
|
||||
if (!HexStringToInt(str, &next_value)) {
|
||||
if (!base::HexStringToInt(str, &next_value)) {
|
||||
fprintf(stderr,
|
||||
"Couldn't parse value: [%.*s]\n",
|
||||
base::checked_cast<int>(bytes.size()),
|
||||
|
@ -62,8 +62,8 @@ bool ReadCPUsOnline(uint32_t* first_cpu, uint8_t* cpu_count) {
|
||||
std::string left, right;
|
||||
if (SplitStringFirst(range, '-', &left, &right)) {
|
||||
unsigned int start, end;
|
||||
if (!StringToUint(base::StringPiece(left), &start) ||
|
||||
!StringToUint(base::StringPiece(right), &end) || end <= start) {
|
||||
if (!base::StringToUint(base::StringPiece(left), &start) ||
|
||||
!base::StringToUint(base::StringPiece(right), &end) || end <= start) {
|
||||
LOG(ERROR) << "format error: " << range;
|
||||
return false;
|
||||
}
|
||||
@ -78,7 +78,7 @@ bool ReadCPUsOnline(uint32_t* first_cpu, uint8_t* cpu_count) {
|
||||
}
|
||||
} else {
|
||||
unsigned int cpuno;
|
||||
if (!StringToUint(base::StringPiece(range), &cpuno)) {
|
||||
if (!base::StringToUint(base::StringPiece(range), &cpuno)) {
|
||||
LOG(ERROR) << "format error";
|
||||
return false;
|
||||
}
|
||||
@ -399,13 +399,13 @@ void SystemSnapshotLinux::ReadKernelVersion(const std::string& version_string) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StringToInt(base::StringPiece(versions[0]), &os_version_major_)) {
|
||||
if (!base::StringToInt(base::StringPiece(versions[0]), &os_version_major_)) {
|
||||
LOG(WARNING) << "no kernel version";
|
||||
return;
|
||||
}
|
||||
DCHECK_GE(os_version_major_, 3);
|
||||
|
||||
if (!StringToInt(base::StringPiece(versions[1]), &os_version_minor_)) {
|
||||
if (!base::StringToInt(base::StringPiece(versions[1]), &os_version_minor_)) {
|
||||
LOG(WARNING) << "no major revision";
|
||||
return;
|
||||
}
|
||||
@ -415,7 +415,7 @@ void SystemSnapshotLinux::ReadKernelVersion(const std::string& version_string) {
|
||||
if (minor_rev_end == std::string::npos) {
|
||||
minor_rev_end = versions[2].size();
|
||||
}
|
||||
if (!StringToInt(base::StringPiece(versions[2].c_str(), minor_rev_end),
|
||||
if (!base::StringToInt(base::StringPiece(versions[2].c_str(), minor_rev_end),
|
||||
&os_version_bugfix_)) {
|
||||
LOG(WARNING) << "no minor revision";
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user