summaryrefslogtreecommitdiffstats
path: root/base/allocator
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-07 17:35:10 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-07 17:35:10 +0000
commit9406c05f78eccb7cc2849cf87a4202e1538ecb9c (patch)
tree37d27e2d2e2f820bc2c045c27a42894d3f76342f /base/allocator
parent381ae07bab785f46f54ee5ad770dbcfabbe92d6e (diff)
downloadchromium_src-9406c05f78eccb7cc2849cf87a4202e1538ecb9c.zip
chromium_src-9406c05f78eccb7cc2849cf87a4202e1538ecb9c.tar.gz
chromium_src-9406c05f78eccb7cc2849cf87a4202e1538ecb9c.tar.bz2
Remove all uses of GG_LONGLONG and GG_ULONGLONG.
123LL and 123ULL now work everywhere. You can also use INT64_C and UINT64_C (from <stdint.h>) in Chromium code (we force-define __STDC_CONSTANT_MACROS). (And sometimes you can just use static_cast<(u)int64_t>.) Don't remove their definitions yet, because some macros that are multiply-defined (in an identical way) rely on them. D'oh. R=brettw@chromium.org TBR=sky@chromium.org,satorux@chromium.org,vrk@chromium.org,rch@chromium.org,shess@chromium.org Review URL: https://codereview.chromium.org/218953003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/allocator')
-rw-r--r--base/allocator/allocator_unittest.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/base/allocator/allocator_unittest.cc b/base/allocator/allocator_unittest.cc
index 4265251..eead75c 100644
--- a/base/allocator/allocator_unittest.cc
+++ b/base/allocator/allocator_unittest.cc
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm> // for min()
+
#include "base/atomicops.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -81,8 +83,6 @@ static int NextSize(int size) {
}
}
-#define GG_ULONGLONG(x) static_cast<uint64>(x)
-
template <class AtomicType>
static void TestAtomicIncrement() {
// For now, we just test single threaded execution
@@ -164,7 +164,7 @@ static void TestCompareAndSwap() {
// Use test value that has non-zero bits in both halves, more for testing
// 64-bit implementation on 32-bit platforms.
- const AtomicType k_test_val = (GG_ULONGLONG(1) <<
+ const AtomicType k_test_val = (static_cast<uint64_t>(1) <<
(NUM_BITS(AtomicType) - 2)) + 11;
value = k_test_val;
prev = base::subtle::NoBarrier_CompareAndSwap(&value, 0, 5);
@@ -187,7 +187,7 @@ static void TestAtomicExchange() {
// Use test value that has non-zero bits in both halves, more for testing
// 64-bit implementation on 32-bit platforms.
- const AtomicType k_test_val = (GG_ULONGLONG(1) <<
+ const AtomicType k_test_val = (static_cast<uint64_t>(1) <<
(NUM_BITS(AtomicType) - 2)) + 11;
value = k_test_val;
new_value = base::subtle::NoBarrier_AtomicExchange(&value, k_test_val);
@@ -205,7 +205,7 @@ template <class AtomicType>
static void TestAtomicIncrementBounds() {
// Test increment at the half-width boundary of the atomic type.
// It is primarily for testing at the 32-bit boundary for 64-bit atomic type.
- AtomicType test_val = GG_ULONGLONG(1) << (NUM_BITS(AtomicType) / 2);
+ AtomicType test_val = static_cast<uint64_t>(1) << (NUM_BITS(AtomicType) / 2);
AtomicType value = test_val - 1;
AtomicType new_value = base::subtle::NoBarrier_AtomicIncrement(&value, 1);
EXPECT_EQ(test_val, value);