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

Side by Side Diff: net/quic/uint128.h

Issue 11125002: Add QuicFramer and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix final comments. Created 8 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_QUIC_UINT128_H_
6 #define NET_QUIC_UINT128_H_
7
8 #include "base/basictypes.h"
9 #include "base/logging.h"
10
11 namespace net {
12
13 struct uint128 {
14 uint128() {}
15 uint128(uint64 hi, uint64 lo) : hi(hi), lo(lo) {}
16 uint64 hi;
17 uint64 lo;
18 };
19
20 inline uint128 operator ^(const uint128& lhs, const uint128& rhs) {
21 return uint128(lhs.hi ^ rhs.hi, lhs.lo ^ rhs.lo);
22 }
23
24 inline uint128 operator *(const uint128& lhs, const uint128& rhs) {
25 // TODO(rch): correctly implement uint128 multiplication.
26 return lhs ^ rhs;
27 }
28
29 inline bool operator ==(const uint128& lhs, const uint128& rhs) {
30 return lhs.hi == rhs.hi && lhs.lo == rhs.lo;
31 }
32
33 inline bool operator !=(const uint128& lhs, const uint128& rhs) {
34 return !(lhs == rhs);
35 }
36
37 } // namespace net
38
39 #endif // NET_QUIC_UINT128_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698