Squash-merge changes from upstream
Merge changes from https://chromium.googlesource.com/chromium/src:
cce8f294b365 cbor: Fix typedef struct naming for new CrOS Clang updates
bd122a20ab2e [base] Remove const iterator member functions from span
768272463b36 Remove more MSVC compat hack
BUG=none
TEST=FEATURES=test emerge-nocturne cbor
Change-Id: I1e718c286b7031df840975971541ceb90117433b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/cbor/+/2145296
Reviewed-by: Yicheng Li <yichengli@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Yicheng Li <yichengli@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
diff --git a/reader_unittest.cc b/reader_unittest.cc
index 7a99958..39a3143 100644
--- a/reader_unittest.cc
+++ b/reader_unittest.cc
@@ -19,7 +19,7 @@
namespace {
std::vector<uint8_t> WithExtraneousData(base::span<const uint8_t> original) {
- std::vector<uint8_t> ret(original.cbegin(), original.cend());
+ std::vector<uint8_t> ret(original.begin(), original.end());
// Add a valid one byte long CBOR data item, namely, an unsigned integer
// with value "1".
ret.push_back(0x01);
diff --git a/writer.cc b/writer.cc
index 6a16808..3c5a273 100644
--- a/writer.cc
+++ b/writer.cc
@@ -134,11 +134,6 @@
return true;
}
}
-
- // This is needed because, otherwise, MSVC complains that not all paths return
- // a value. We should be able to remove it once MSVC builders are gone.
- NOTREACHED();
- return false;
}
void Writer::StartItem(Value::Type type, uint64_t size) {
diff --git a/writer_unittest.cc b/writer_unittest.cc
index d2b8453..912a4ba 100644
--- a/writer_unittest.cc
+++ b/writer_unittest.cc
@@ -16,10 +16,10 @@
namespace cbor {
TEST(CBORWriterTest, TestWriteUint) {
- typedef struct {
+ struct UintTestCase {
const int64_t value;
const base::StringPiece cbor;
- } UintTestCase;
+ };
static const UintTestCase kUintTestCases[] = {
// Reminder: must specify length when creating string pieces
@@ -76,10 +76,10 @@
}
TEST(CBORWriterTest, TestWriteBytes) {
- typedef struct {
+ struct BytesTestCase {
const std::vector<uint8_t> bytes;
const base::StringPiece cbor;
- } BytesTestCase;
+ };
static const BytesTestCase kBytesTestCases[] = {
{{}, base::StringPiece("\x40")},
@@ -94,10 +94,10 @@
}
TEST(CBORWriterTest, TestWriteString) {
- typedef struct {
+ struct StringTestCase {
const std::string string;
const base::StringPiece cbor;
- } StringTestCase;
+ };
static const StringTestCase kStringTestCases[] = {
{"", base::StringPiece("\x60")},