summaryrefslogtreecommitdiffstats
path: root/base/bits.h
diff options
context:
space:
mode:
authoravi <avi@chromium.org>2015-12-26 14:15:14 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-26 22:16:15 +0000
commit9b6f42934e5a1e65ebfc668d91a28a6e2678a14c (patch)
tree6fb35dc2e15b6aeb7ce5d8fb2daf08f58c6d77e7 /base/bits.h
parent28523e2cf18ee02f503e1792788b88d828968055 (diff)
downloadchromium_src-9b6f42934e5a1e65ebfc668d91a28a6e2678a14c.zip
chromium_src-9b6f42934e5a1e65ebfc668d91a28a6e2678a14c.tar.gz
chromium_src-9b6f42934e5a1e65ebfc668d91a28a6e2678a14c.tar.bz2
Switch to standard integer types in base/.
BUG=138542 TBR=mark@chromium.org NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1538743002 Cr-Commit-Position: refs/heads/master@{#366910}
Diffstat (limited to 'base/bits.h')
-rw-r--r--base/bits.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/base/bits.h b/base/bits.h
index 505d2c8..a3a59d1 100644
--- a/base/bits.h
+++ b/base/bits.h
@@ -7,21 +7,23 @@
#ifndef BASE_BITS_H_
#define BASE_BITS_H_
-#include "base/basictypes.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/logging.h"
namespace base {
namespace bits {
// Returns the integer i such as 2^i <= n < 2^(i+1)
-inline int Log2Floor(uint32 n) {
+inline int Log2Floor(uint32_t n) {
if (n == 0)
return -1;
int log = 0;
- uint32 value = n;
+ uint32_t value = n;
for (int i = 4; i >= 0; --i) {
int shift = (1 << i);
- uint32 x = value >> shift;
+ uint32_t x = value >> shift;
if (x != 0) {
value = x;
log += shift;
@@ -32,7 +34,7 @@ inline int Log2Floor(uint32 n) {
}
// Returns the integer i such as 2^(i-1) < n <= 2^i
-inline int Log2Ceiling(uint32 n) {
+inline int Log2Ceiling(uint32_t n) {
if (n == 0) {
return -1;
} else {