Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Unified Diff: net/quic/quic_data_writer.cc

Issue 11299023: Add real support for uint128. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more try Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_data_writer.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_data_writer.cc
diff --git a/net/quic/quic_data_writer.cc b/net/quic/quic_data_writer.cc
index 1db9f301fbb00e5509094bef0ca7ffc6a71149e2..42b5dc4e0b02c9f394856d7a7e0659a8500c414b 100644
--- a/net/quic/quic_data_writer.cc
+++ b/net/quic/quic_data_writer.cc
@@ -56,7 +56,7 @@ bool QuicDataWriter::WriteUInt64(uint64 value) {
}
bool QuicDataWriter::WriteUInt128(uint128 value) {
- return WriteUInt64(value.lo) && WriteUInt64(value.hi);
+ return WriteUInt64(Uint128Low64(value)) && WriteUInt64(Uint128High64(value));
}
bool QuicDataWriter::WriteStringPiece16(StringPiece val) {
@@ -117,8 +117,10 @@ void QuicDataWriter::WriteUint64ToBuffer(uint64 value, char* buffer) {
}
void QuicDataWriter::WriteUint128ToBuffer(uint128 value, char* buffer) {
- WriteUint64ToBuffer(value.lo, buffer);
- WriteUint64ToBuffer(value.hi, buffer + sizeof(value.lo));
+ uint64 high = Uint128High64(value);
+ uint64 low = Uint128Low64(value);
+ WriteUint64ToBuffer(low, buffer);
+ WriteUint64ToBuffer(high, buffer + sizeof(low));
}
} // namespace net
« no previous file with comments | « net/quic/quic_data_writer.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698