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

Unified Diff: base/bits.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/bind_unittest.nc ('k') | base/bits_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bits.h
diff --git a/base/bits.h b/base/bits.h
deleted file mode 100644
index b2209e8ed7934a6dfc918c3d7d12b9c455f594e1..0000000000000000000000000000000000000000
--- a/base/bits.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file defines some bit utilities.
-
-#ifndef BASE_BITS_H_
-#define BASE_BITS_H_
-
-#include "base/basictypes.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) {
- if (n == 0)
- return -1;
- int log = 0;
- uint32 value = n;
- for (int i = 4; i >= 0; --i) {
- int shift = (1 << i);
- uint32 x = value >> shift;
- if (x != 0) {
- value = x;
- log += shift;
- }
- }
- DCHECK_EQ(value, 1u);
- return log;
-}
-
-// Returns the integer i such as 2^(i-1) < n <= 2^i
-inline int Log2Ceiling(uint32 n) {
- if (n == 0) {
- return -1;
- } else {
- // Log2Floor returns -1 for 0, so the following works correctly for n=1.
- return 1 + Log2Floor(n - 1);
- }
-}
-
-} // namespace bits
-} // namespace base
-
-#endif // BASE_BITS_H_
« no previous file with comments | « base/bind_unittest.nc ('k') | base/bits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698