From: Adam Simpkins Date: Wed, 4 Dec 2013 03:33:47 +0000 (-0800) Subject: fix issues when compiling with clang X-Git-Tag: v0.22.0~773 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=29eecd37d773918cc0081938da7562852151c69f fix issues when compiling with clang Summary: My previous change to re-implement IOBuf's internal storage mechanism introduced a build failure when compiling with clang. This fixes the new compilation error in IOBuf.cpp, as well as two existing build failures in some of the unit tests. Test Plan: Built the folly/io code with clang. Reviewed By: andrewjcg@fb.com FB internal diff: D1082086 --- diff --git a/folly/io/IOBuf.cpp b/folly/io/IOBuf.cpp index cf961e73..65f7624d 100644 --- a/folly/io/IOBuf.cpp +++ b/folly/io/IOBuf.cpp @@ -123,7 +123,7 @@ void IOBuf::operator delete(void* ptr) { } void IOBuf::releaseStorage(HeapStorage* storage, uint16_t freeFlags) { - CHECK_EQ(storage->prefix.magic, kHeapMagic); + CHECK_EQ(storage->prefix.magic, static_cast(kHeapMagic)); // Use relaxed memory order here. If we are unlucky and happen to get // out-of-date data the compare_exchange_weak() call below will catch diff --git a/folly/io/test/IOBufTest.cpp b/folly/io/test/IOBufTest.cpp index a9e2ace3..5fc86644 100644 --- a/folly/io/test/IOBufTest.cpp +++ b/folly/io/test/IOBufTest.cpp @@ -749,7 +749,7 @@ TEST(IOBuf, takeOwnershipUniquePtr) { destructorCount = 0; { std::unique_ptr - p(new OwnershipTestClass[2], customDeleteArray); + p(new OwnershipTestClass[2], CustomDeleter(customDeleteArray)); std::unique_ptr buf(IOBuf::takeOwnership(std::move(p), 2)); EXPECT_EQ(2 * sizeof(OwnershipTestClass), buf->length()); EXPECT_EQ(0, destructorCount); diff --git a/folly/io/test/RecordIOTest.cpp b/folly/io/test/RecordIOTest.cpp index 9f4d2699..4c12f817 100644 --- a/folly/io/test/RecordIOTest.cpp +++ b/folly/io/test/RecordIOTest.cpp @@ -37,7 +37,6 @@ namespace folly { namespace test { namespace { // shortcut -ByteRange br(StringPiece sp) { return ByteRange(sp); } StringPiece sp(ByteRange br) { return StringPiece(br); } template