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

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

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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/node_ordinal.h ('k') | components/sync/base/node_ordinal_unittest.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 "sync/internal_api/public/base/node_ordinal.h" 5 #include "components/sync/base/node_ordinal.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <string> 11 #include <string>
12 12
13 namespace syncer { 13 namespace syncer {
14 14
15 NodeOrdinal Int64ToNodeOrdinal(int64_t x) { 15 NodeOrdinal Int64ToNodeOrdinal(int64_t x) {
(...skipping 26 matching lines...) Expand all
42 const uint8_t byte = s[l - i - 1]; 42 const uint8_t byte = s[l - i - 1];
43 y |= static_cast<uint64_t>(byte) << (i * 8); 43 y |= static_cast<uint64_t>(byte) << (i * 8);
44 } 44 }
45 y ^= 0x8000000000000000ULL; 45 y ^= 0x8000000000000000ULL;
46 // This is technically implementation-defined if y > INT64_MAX, so 46 // This is technically implementation-defined if y > INT64_MAX, so
47 // we're assuming that we're on a twos-complement machine. 47 // we're assuming that we're on a twos-complement machine.
48 return static_cast<int64_t>(y); 48 return static_cast<int64_t>(y);
49 } 49 }
50 50
51 } // namespace syncer 51 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/node_ordinal.h ('k') | components/sync/base/node_ordinal_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698