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

Side by Side Diff: src/gpu/GrTHashTable.h

Issue 242643008: fix warnings around size_t/int (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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 | « src/core/SkPicturePlayback.cpp ('k') | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // testing 54 // testing
55 const SkTDArray<T*>& getArray() const { return fSorted; } 55 const SkTDArray<T*>& getArray() const { return fSorted; }
56 SkTDArray<T*>& getArray() { return fSorted; } 56 SkTDArray<T*>& getArray() { return fSorted; }
57 private: 57 private:
58 void clearHash() { sk_bzero(fHash, sizeof(fHash)); } 58 void clearHash() { sk_bzero(fHash, sizeof(fHash)); }
59 59
60 enum { 60 enum {
61 kHashCount = 1 << kHashBits, 61 kHashCount = 1 << kHashBits,
62 kHashMask = kHashCount - 1 62 kHashMask = kHashCount - 1
63 }; 63 };
64 static unsigned hash2Index(uint32_t hash) { 64 static unsigned hash2Index(intptr_t hash) {
65 if (sizeof(hash) == 8) {
66 hash ^= hash >> 32;
67 }
65 hash ^= hash >> 16; 68 hash ^= hash >> 16;
66 if (kHashBits <= 8) { 69 if (kHashBits <= 8) {
67 hash ^= hash >> 8; 70 hash ^= hash >> 8;
68 } 71 }
69 return hash & kHashMask; 72 return hash & kHashMask;
70 } 73 }
71 74
72 mutable T* fHash[kHashCount]; 75 mutable T* fHash[kHashCount];
73 SkTDArray<T*> fSorted; 76 SkTDArray<T*> fSorted;
74 77
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 204
202 template <typename T, typename Key, size_t kHashBits> 205 template <typename T, typename Key, size_t kHashBits>
203 bool GrTHashTable<T, Key, kHashBits>::contains(T* elem) const { 206 bool GrTHashTable<T, Key, kHashBits>::contains(T* elem) const {
204 int index = fSorted.find(elem); 207 int index = fSorted.find(elem);
205 return index >= 0; 208 return index >= 0;
206 } 209 }
207 210
208 #endif 211 #endif
209 212
210 #endif 213 #endif
OLDNEW
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698