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

Unified Diff: base/allocator/allocator_unittest.cc

Issue 218953003: Remove all uses of GG_LONGLONG and GG_ULONGLONG. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win? Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/atomicops_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_unittest.cc
diff --git a/base/allocator/allocator_unittest.cc b/base/allocator/allocator_unittest.cc
index 4265251cfa8e1ab303c63dae643227e4fc5b66a7..eb20b38ab6156f640d938edfe28914146ac3e15e 100644
--- a/base/allocator/allocator_unittest.cc
+++ b/base/allocator/allocator_unittest.cc
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <algorithm> // for min()
+
#include "base/atomicops.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -81,8 +82,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 +163,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 +186,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 +204,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);
« no previous file with comments | « no previous file | base/atomicops_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698