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

Side by Side Diff: components/sync/base/node_ordinal.cc

Issue 2387553002: [Sync] Removing duplicated includes between cc and h files. (Closed)
Patch Set: Fixing DataTypeStatusTable Created 4 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
« no previous file with comments | « components/sync/base/attachment_id_proto.cc ('k') | components/sync/base/time.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/base/node_ordinal.h" 5 #include "components/sync/base/node_ordinal.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
10 #include <algorithm> 7 #include <algorithm>
11 #include <string> 8 #include <string>
12 9
13 namespace syncer { 10 namespace syncer {
14 11
15 NodeOrdinal Int64ToNodeOrdinal(int64_t x) { 12 NodeOrdinal Int64ToNodeOrdinal(int64_t x) {
16 uint64_t y = static_cast<uint64_t>(x); 13 uint64_t y = static_cast<uint64_t>(x);
17 y ^= 0x8000000000000000ULL; 14 y ^= 0x8000000000000000ULL;
18 std::string bytes(NodeOrdinal::kMinLength, '\x00'); 15 std::string bytes(NodeOrdinal::kMinLength, '\x00');
19 if (y == 0) { 16 if (y == 0) {
(...skipping 22 matching lines...) Expand all
42 const uint8_t byte = s[l - i - 1]; 39 const uint8_t byte = s[l - i - 1];
43 y |= static_cast<uint64_t>(byte) << (i * 8); 40 y |= static_cast<uint64_t>(byte) << (i * 8);
44 } 41 }
45 y ^= 0x8000000000000000ULL; 42 y ^= 0x8000000000000000ULL;
46 // This is technically implementation-defined if y > INT64_MAX, so 43 // This is technically implementation-defined if y > INT64_MAX, so
47 // we're assuming that we're on a twos-complement machine. 44 // we're assuming that we're on a twos-complement machine.
48 return static_cast<int64_t>(y); 45 return static_cast<int64_t>(y);
49 } 46 }
50 47
51 } // namespace syncer 48 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/attachment_id_proto.cc ('k') | components/sync/base/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698