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

Side by Side Diff: src/utils/SkBitSet.h

Issue 13146005: Fix minor cppcheck-found issues (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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/ports/SkFontHost_mac.cpp ('k') | src/utils/SkBitSet.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 2011 Google Inc. 3 * Copyright 2011 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 #ifndef SkBitSet_DEFINED 10 #ifndef SkBitSet_DEFINED
11 #define SkBitSet_DEFINED 11 #define SkBitSet_DEFINED
12 12
13 #include "SkTypes.h" 13 #include "SkTypes.h"
14 #include "SkTDArray.h" 14 #include "SkTDArray.h"
15 15
16 class SkBitSet { 16 class SkBitSet {
17 public: 17 public:
18 /** NumberOfBits must be greater than zero. 18 /** NumberOfBits must be greater than zero.
19 */ 19 */
20 explicit SkBitSet(int numberOfBits); 20 explicit SkBitSet(int numberOfBits);
21 explicit SkBitSet(const SkBitSet& source); 21 explicit SkBitSet(const SkBitSet& source);
22 22
23 const SkBitSet& operator=(const SkBitSet& rhs); 23 SkBitSet& operator=(const SkBitSet& rhs);
reed1 2013/03/28 13:34:46 that's a funny mistake.
24 bool operator==(const SkBitSet& rhs); 24 bool operator==(const SkBitSet& rhs);
25 bool operator!=(const SkBitSet& rhs); 25 bool operator!=(const SkBitSet& rhs);
26 26
27 /** Clear all data. 27 /** Clear all data.
28 */ 28 */
29 void clearAll(); 29 void clearAll();
30 30
31 /** Set the value of the index-th bit. 31 /** Set the value of the index-th bit.
32 */ 32 */
33 void setBit(int index, bool value); 33 void setBit(int index, bool value);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 uint32_t* internalGet(int index) const { 69 uint32_t* internalGet(int index) const {
70 SkASSERT((size_t)index < fBitCount); 70 SkASSERT((size_t)index < fBitCount);
71 size_t internalIndex = index / 32; 71 size_t internalIndex = index / 32;
72 SkASSERT(internalIndex < fDwordCount); 72 SkASSERT(internalIndex < fDwordCount);
73 return reinterpret_cast<uint32_t*>(fBitData.get()) + internalIndex; 73 return reinterpret_cast<uint32_t*>(fBitData.get()) + internalIndex;
74 } 74 }
75 }; 75 };
76 76
77 77
78 #endif 78 #endif
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | src/utils/SkBitSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698