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

Side by Side Diff: base/bits.h

Issue 10735044: Remove #pragma once. Just from base/ for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/bind_internal_win.h.pump ('k') | base/build_time.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file defines some bit utilities. 5 // This file defines some bit utilities.
6 6
7 #ifndef BASE_BITS_H_ 7 #ifndef BASE_BITS_H_
8 #define BASE_BITS_H_ 8 #define BASE_BITS_H_
9 #pragma once
10 9
11 #include "base/basictypes.h" 10 #include "base/basictypes.h"
12 #include "base/logging.h" 11 #include "base/logging.h"
13 12
14 namespace base { 13 namespace base {
15 namespace bits { 14 namespace bits {
16 15
17 // Returns the integer i such as 2^i <= n < 2^(i+1) 16 // Returns the integer i such as 2^i <= n < 2^(i+1)
18 inline int Log2Floor(uint32 n) { 17 inline int Log2Floor(uint32 n) {
19 if (n == 0) 18 if (n == 0)
(...skipping 19 matching lines...) Expand all
39 } else { 38 } else {
40 // Log2Floor returns -1 for 0, so the following works correctly for n=1. 39 // Log2Floor returns -1 for 0, so the following works correctly for n=1.
41 return 1 + Log2Floor(n - 1); 40 return 1 + Log2Floor(n - 1);
42 } 41 }
43 } 42 }
44 43
45 } // namespace bits 44 } // namespace bits
46 } // namespace base 45 } // namespace base
47 46
48 #endif // BASE_BITS_H_ 47 #endif // BASE_BITS_H_
OLDNEW
« no previous file with comments | « base/bind_internal_win.h.pump ('k') | base/build_time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698