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

Side by Side Diff: base/hash.cc

Issue 10920026: Move hash.h/cc from net/disk_cache to base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan, rvargas feedback Created 8 years, 3 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 | « base/hash.h ('k') | content/common/gpu/gpu_command_buffer_stub.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 // From http://www.azillionmonkeys.com/qed/hash.html 1 // From http://www.azillionmonkeys.com/qed/hash.html
2 2
3 #include "net/disk_cache/hash.h" 3 #include "base/hash.h"
4 4
5 typedef uint32 uint32_t; 5 typedef uint32 uint32_t;
6 typedef uint16 uint16_t; 6 typedef uint16 uint16_t;
7 7
8 namespace disk_cache { 8 namespace base {
9 9
10 #undef get16bits 10 #undef get16bits
11 #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ 11 #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
12 || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) 12 || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
13 #define get16bits(d) (*((const uint16_t *) (d))) 13 #define get16bits(d) (*((const uint16_t *) (d)))
14 #endif 14 #endif
15 15
16 #if !defined (get16bits) 16 #if !defined (get16bits)
17 #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ 17 #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
18 +(uint32_t)(((const uint8_t *)(d))[0]) ) 18 +(uint32_t)(((const uint8_t *)(d))[0]) )
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 hash ^= hash << 3; 63 hash ^= hash << 3;
64 hash += hash >> 5; 64 hash += hash >> 5;
65 hash ^= hash << 4; 65 hash ^= hash << 4;
66 hash += hash >> 17; 66 hash += hash >> 17;
67 hash ^= hash << 25; 67 hash ^= hash << 25;
68 hash += hash >> 6; 68 hash += hash >> 6;
69 69
70 return hash; 70 return hash;
71 } 71 }
72 72
73 } // namespace disk_cache 73 } // namespace base
OLDNEW
« no previous file with comments | « base/hash.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698