| Index: net/quic/quic_data_writer.cc
|
| diff --git a/net/quic/quic_data_writer.cc b/net/quic/quic_data_writer.cc
|
| index 96ae213f1b9feff764a1628cbe70dbe3ddf30585..81cc7127f7e9e9a85a45b21fc5bff0e2d0af45ca 100644
|
| --- a/net/quic/quic_data_writer.cc
|
| +++ b/net/quic/quic_data_writer.cc
|
| @@ -22,44 +22,44 @@ char* QuicDataWriter::data() {
|
| return buffer_;
|
| }
|
|
|
| -bool QuicDataWriter::WriteUInt8(uint8 value) {
|
| +bool QuicDataWriter::WriteUInt8(uint8_t value) {
|
| return WriteBytes(&value, sizeof(value));
|
| }
|
|
|
| -bool QuicDataWriter::WriteUInt16(uint16 value) {
|
| +bool QuicDataWriter::WriteUInt16(uint16_t value) {
|
| return WriteBytes(&value, sizeof(value));
|
| }
|
|
|
| -bool QuicDataWriter::WriteUInt32(uint32 value) {
|
| +bool QuicDataWriter::WriteUInt32(uint32_t value) {
|
| return WriteBytes(&value, sizeof(value));
|
| }
|
|
|
| -bool QuicDataWriter::WriteUInt48(uint64 value) {
|
| - uint16 hi = static_cast<uint16>(value >> 32);
|
| - uint32 lo = static_cast<uint32>(value);
|
| +bool QuicDataWriter::WriteUInt48(uint64_t value) {
|
| + uint16_t hi = static_cast<uint16_t>(value >> 32);
|
| + uint32_t lo = static_cast<uint32_t>(value);
|
| return WriteUInt32(lo) && WriteUInt16(hi);
|
| }
|
|
|
| -bool QuicDataWriter::WriteUInt64(uint64 value) {
|
| +bool QuicDataWriter::WriteUInt64(uint64_t value) {
|
| return WriteBytes(&value, sizeof(value));
|
| }
|
|
|
| -bool QuicDataWriter::WriteUFloat16(uint64 value) {
|
| - uint16 result;
|
| +bool QuicDataWriter::WriteUFloat16(uint64_t value) {
|
| + uint16_t result;
|
| if (value < (UINT64_C(1) << kUFloat16MantissaEffectiveBits)) {
|
| // Fast path: either the value is denormalized, or has exponent zero.
|
| // Both cases are represented by the value itself.
|
| - result = static_cast<uint16>(value);
|
| + result = static_cast<uint16_t>(value);
|
| } else if (value >= kUFloat16MaxValue) {
|
| // Value is out of range; clamp it to the maximum representable.
|
| - result = numeric_limits<uint16>::max();
|
| + result = numeric_limits<uint16_t>::max();
|
| } else {
|
| // The highest bit is between position 13 and 42 (zero-based), which
|
| // corresponds to exponent 1-30. In the output, mantissa is from 0 to 10,
|
| // hidden bit is 11 and exponent is 11 to 15. Shift the highest bit to 11
|
| // and count the shifts.
|
| - uint16 exponent = 0;
|
| - for (uint16 offset = 16; offset > 0; offset /= 2) {
|
| + uint16_t exponent = 0;
|
| + for (uint16_t offset = 16; offset > 0; offset /= 2) {
|
| // Right-shift the value until the highest bit is in position 11.
|
| // For offset of 16, 8, 4, 2 and 1 (binary search over 1-30),
|
| // shift if the bit is at or above 11 + offset.
|
| @@ -77,17 +77,17 @@ bool QuicDataWriter::WriteUFloat16(uint64 value) {
|
| // Hidden bit (position 11) is set. We should remove it and increment the
|
| // exponent. Equivalently, we just add it to the exponent.
|
| // This hides the bit.
|
| - result = static_cast<uint16>(value + (exponent << kUFloat16MantissaBits));
|
| + result = static_cast<uint16_t>(value + (exponent << kUFloat16MantissaBits));
|
| }
|
|
|
| return WriteBytes(&result, sizeof(result));
|
| }
|
|
|
| bool QuicDataWriter::WriteStringPiece16(StringPiece val) {
|
| - if (val.size() > numeric_limits<uint16>::max()) {
|
| + if (val.size() > numeric_limits<uint16_t>::max()) {
|
| return false;
|
| }
|
| - if (!WriteUInt16(static_cast<uint16>(val.size()))) {
|
| + if (!WriteUInt16(static_cast<uint16_t>(val.size()))) {
|
| return false;
|
| }
|
| return WriteBytes(val.data(), val.size());
|
| @@ -103,7 +103,7 @@ char* QuicDataWriter::BeginWrite(size_t length) {
|
| }
|
|
|
| #ifdef ARCH_CPU_64_BITS
|
| - DCHECK_LE(length, std::numeric_limits<uint32>::max());
|
| + DCHECK_LE(length, std::numeric_limits<uint32_t>::max());
|
| #endif
|
|
|
| return buffer_ + length_;
|
| @@ -121,7 +121,7 @@ bool QuicDataWriter::WriteBytes(const void* data, size_t data_len) {
|
| return true;
|
| }
|
|
|
| -bool QuicDataWriter::WriteRepeatedByte(uint8 byte, size_t count) {
|
| +bool QuicDataWriter::WriteRepeatedByte(uint8_t byte, size_t count) {
|
| char* dest = BeginWrite(count);
|
| if (!dest) {
|
| return false;
|
|
|