Skip to content

Commit

Permalink
Merge r220567 - Unreviewed, attempt to fix build failure with VC2017
Browse files Browse the repository at this point in the history
Source/WTF:

* wtf/PriorityQueue.h:

Tools:

* TestWebKitAPI/Tests/WTF/PriorityQueue.cpp:
(TEST):
  • Loading branch information
Constellation authored and carlosgcampos committed Aug 14, 2017
1 parent a7c7d06 commit 58aa303
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Source/WTF/ChangeLog
@@ -1,3 +1,9 @@
2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>

Unreviewed, attempt to fix build failure with VC2017

* wtf/PriorityQueue.h:

2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>

Run more WTF tests
Expand Down
2 changes: 1 addition & 1 deletion Source/WTF/wtf/PriorityQueue.h
Expand Up @@ -37,7 +37,7 @@ namespace WTF {
// 2) You can iterate the elements.
// 3) It has in-place decrease/increaseKey methods, although they are still O(n) rather than O(log(n)).

template<typename T, bool (*isHigherPriority)(const T&, const T&) = isLessThan<T>, size_t inlineCapacity = 0>
template<typename T, bool (*isHigherPriority)(const T&, const T&) = &isLessThan<T>, size_t inlineCapacity = 0>
class PriorityQueue {
using BufferType = Vector<T, inlineCapacity>;
using const_iterator = typename BufferType::const_iterator;
Expand Down
7 changes: 7 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,10 @@
2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>

Unreviewed, attempt to fix build failure with VC2017

* TestWebKitAPI/Tests/WTF/PriorityQueue.cpp:
(TEST):

2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>

Unreviewed, suppress warnings on GCC
Expand Down
10 changes: 5 additions & 5 deletions Tools/TestWebKitAPI/Tests/WTF/PriorityQueue.cpp
Expand Up @@ -76,7 +76,7 @@ TEST(WTF_PriorityQueue, Basic)
TEST(WTF_PriorityQueue, CustomPriorityFunction)
{
const unsigned numElements = 10;
PriorityQueue<unsigned, isGreaterThan<unsigned>> queue;
PriorityQueue<unsigned, &isGreaterThan<unsigned>> queue;

EXPECT_EQ(0_z, queue.size());
EXPECT_TRUE(queue.isEmpty());
Expand Down Expand Up @@ -106,7 +106,7 @@ struct CompareMove {

TEST(WTF_PriorityQueue, MoveOnly)
{
PriorityQueue<MoveOnly, CompareMove<isLessThan<unsigned>>::compare> queue;
PriorityQueue<MoveOnly, &CompareMove<&isLessThan<unsigned>>::compare> queue;

Vector<unsigned> values = { 23, 54, 4, 8, 1, 2, 4, 0 };
Vector<unsigned> sorted = values;
Expand All @@ -123,7 +123,7 @@ TEST(WTF_PriorityQueue, MoveOnly)

TEST(WTF_PriorityQueue, DecreaseKey)
{
PriorityQueue<MoveOnly, CompareMove<isLessThan<unsigned>>::compare> queue;
PriorityQueue<MoveOnly, &CompareMove<&isLessThan<unsigned>>::compare> queue;

Vector<unsigned> values = { 23, 54, 4, 8, 1, 2, 4, 0 };
Vector<unsigned> sorted = values;
Expand All @@ -149,7 +149,7 @@ TEST(WTF_PriorityQueue, DecreaseKey)

TEST(WTF_PriorityQueue, IncreaseKey)
{
PriorityQueue<MoveOnly, CompareMove<isGreaterThan<unsigned>>::compare> queue;
PriorityQueue<MoveOnly, &CompareMove<&isGreaterThan<unsigned>>::compare> queue;

Vector<unsigned> values = { 23, 54, 4, 8, 1, 2, 4, 0 };
Vector<unsigned> sorted = values;
Expand All @@ -175,7 +175,7 @@ TEST(WTF_PriorityQueue, IncreaseKey)

TEST(WTF_PriorityQueue, Iteration)
{
PriorityQueue<MoveOnly, CompareMove<isGreaterThan<unsigned>>::compare> queue;
PriorityQueue<MoveOnly, &CompareMove<&isGreaterThan<unsigned>>::compare> queue;

Vector<unsigned> values = { 23, 54, 4, 8, 1, 2, 4, 0 };
Vector<unsigned> sorted = values;
Expand Down

0 comments on commit 58aa303

Please sign in to comment.