Commit 94f59e26 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Apply clang-format to folly/io/ (namespace)

Summary: [Folly] Apply `clang-format` to `folly/io/` (namespace).

Reviewed By: Orvid, terrelln

Differential Revision: D5366477

fbshipit-source-id: b4efcdc66c62885f5574b2940e5138590710deae
parent 4b5711db
......@@ -58,7 +58,8 @@
#include <algorithm>
#include <unordered_set>
namespace folly { namespace io {
namespace folly {
namespace io {
Codec::Codec(CodecType type) : type_(type) { }
......@@ -512,7 +513,7 @@ inline uint64_t decodeVarintFromCursor(folly::io::Cursor& cursor) {
return val;
}
} // namespace
} // namespace
#endif // FOLLY_HAVE_LIBLZ4 || FOLLY_HAVE_LIBLZMA
......@@ -2323,4 +2324,5 @@ std::unique_ptr<Codec> getAutoUncompressionCodec(
std::vector<std::unique_ptr<Codec>> customCodecs) {
return AutomaticCodec::create(std::move(customCodecs));
}
}} // namespaces
} // namespace io
} // namespace folly
......@@ -30,7 +30,8 @@
* Compression / decompression over IOBufs
*/
namespace folly { namespace io {
namespace folly {
namespace io {
enum class CodecType {
/**
......@@ -466,4 +467,5 @@ bool hasCodec(CodecType type);
* Check if a specified codec is supported and supports streaming.
*/
bool hasStreamCodec(CodecType type);
}} // namespaces
} // namespace io
} // namespace folly
......@@ -105,6 +105,6 @@ void CursorBase<Derived, BufType>::skipWhile(const Predicate& predicate) {
CursorNoopAppender appender;
readWhile(predicate, appender);
}
}
}
} // folly::io::detail
} // namespace detail
} // namespace io
} // namespace folly
......@@ -18,7 +18,8 @@
#include <cstdio>
#include <folly/ScopeGuard.h>
namespace folly { namespace io {
namespace folly {
namespace io {
void Appender::printf(const char* fmt, ...) {
va_list ap;
......@@ -68,5 +69,5 @@ void Appender::vprintf(const char* fmt, va_list ap) {
}
append(len);
}
}} // folly::io
} // namespace io
} // namespace folly
......@@ -48,7 +48,8 @@
* Appender with a buffer chain; for this reason, Appenders assume private
* access to the buffer (you need to call unshare() yourself if necessary).
**/
namespace folly { namespace io {
namespace folly {
namespace io {
namespace detail {
......@@ -618,7 +619,7 @@ class CursorBase {
BufType* buffer_;
};
} // namespace detail
} // namespace detail
class Cursor : public detail::CursorBase<Cursor, const IOBuf> {
public:
......@@ -1049,7 +1050,7 @@ class QueueAppender : public detail::Writable<QueueAppender> {
folly::IOBufQueue* queue_;
size_t growth_;
};
}} // folly::io
} // namespace io
} // namespace folly
#include <folly/io/Cursor-inl.h>
......@@ -82,7 +82,7 @@ FOLLY_PACK_POP
static_assert(offsetof(Header, headerHash) + sizeof(Header::headerHash) ==
sizeof(Header), "invalid header layout");
} // namespace detail
} // namespace detail
constexpr size_t headerSize() { return sizeof(detail::Header); }
......@@ -90,6 +90,6 @@ inline RecordInfo findRecord(ByteRange range, uint32_t fileId) {
return findRecord(range, range, fileId);
}
} // namespace recordio_helpers
} // namespace recordio_helpers
} // namespaces
} // namespace folly
......@@ -138,7 +138,7 @@ uint64_t dataHash(ByteRange range) {
return hash::SpookyHashV2::Hash64(range.data(), range.size(), kHashSeed);
}
} // namespace
} // namespace
size_t prependHeader(std::unique_ptr<IOBuf>& buf, uint32_t fileId) {
if (fileId == 0) {
......@@ -229,6 +229,6 @@ RecordInfo findRecord(ByteRange searchRange,
return {0, {}};
}
} // namespace
} // namespace recordio_helpers
} // namespaces
} // namespace folly
......@@ -172,8 +172,8 @@ RecordInfo findRecord(ByteRange range, uint32_t fileId);
*/
RecordInfo validateRecord(ByteRange range, uint32_t fileId);
} // namespace recordio_helpers
} // namespace recordio_helpers
} // namespaces
} // namespace folly
#include <folly/io/RecordIO-inl.h>
......@@ -176,4 +176,4 @@ void ShutdownSocketSet::doShutdown(int fd, bool abortive) {
folly::dup2NoInt(nullFile_.fd(), fd);
}
} // namespaces
} // namespace folly
......@@ -117,4 +117,4 @@ class ShutdownSocketSet : private boost::noncopyable {
folly::File nullFile_;
};
} // namespaces
} // namespace folly
......@@ -212,4 +212,4 @@ class TypedIOBuf {
IOBuf* buf_;
};
} // namespace folly
} // namespace folly
......@@ -38,7 +38,9 @@
#include <zstd.h>
#endif
namespace folly { namespace io { namespace test {
namespace folly {
namespace io {
namespace test {
class DataHolder : private boost::noncopyable {
public:
......@@ -1127,7 +1129,9 @@ TEST(ZstdTest, BackwardCompatible) {
}
#endif
}}} // namespaces
} // namespace test
} // namespace io
} // namespace folly
int main(int argc, char *argv[]) {
testing::InitGoogleTest(&argc, argv);
......
......@@ -190,7 +190,7 @@ std::string toString(const IOBuf& buf) {
return str;
}
} // namespace
} // namespace
TEST(IOBuf, PullAndPeek) {
std::unique_ptr<IOBuf> iobuf1(IOBuf::create(10));
......
......@@ -755,7 +755,7 @@ void customDeleteArray(OwnershipTestClass* p) {
delete[] p;
}
} // namespace
} // namespace
TEST(IOBuf, takeOwnershipUniquePtr) {
destructorCount = 0;
......@@ -1041,7 +1041,7 @@ namespace {
std::unique_ptr<IOBuf> fromStr(StringPiece sp) {
return IOBuf::copyBuffer(ByteRange(sp));
}
} // namespace
} // namespace
TEST(IOBuf, HashAndEqual) {
folly::IOBufEqual eq;
......@@ -1240,7 +1240,7 @@ char* writableStr(folly::IOBuf& buf) {
return reinterpret_cast<char*>(buf.writableData());
}
} // namespace
} // namespace
TEST(IOBuf, ExternallyShared) {
struct Item {
......
......@@ -33,7 +33,8 @@
DEFINE_int32(random_seed, folly::randomNumberSeed(), "random seed");
namespace folly { namespace test {
namespace folly {
namespace test {
namespace {
// shortcut
......@@ -49,7 +50,7 @@ std::unique_ptr<IOBuf> iobufs(std::initializer_list<T> ranges) {
return queue.move();
}
} // namespace
} // namespace
TEST(RecordIOTest, Simple) {
TemporaryFile file;
......@@ -189,7 +190,7 @@ void corrupt(int fd, off_t pos) {
++val;
EXPECT_EQ(1, pwrite(fd, &val, 1, pos));
}
} // namespace
} // namespace
TEST(RecordIOTest, Randomized) {
SCOPED_TRACE(to<std::string>("Random seed is ", FLAGS_random_seed));
......@@ -262,8 +263,9 @@ TEST(RecordIOTest, Randomized) {
EXPECT_EQ(records.size(), i);
}
}
} // namespace test
} // namespace folly
}} // namespaces
int main(int argc, char *argv[]) {
testing::InitGoogleTest(&argc, argv);
......
......@@ -28,7 +28,8 @@ using folly::ShutdownSocketSet;
namespace fsp = folly::portability::sockets;
namespace folly { namespace test {
namespace folly {
namespace test {
ShutdownSocketSet shutdownSocketSet;
......@@ -221,5 +222,5 @@ TEST(ShutdownSocketSetTest, OrderlyKill) {
TEST(ShutdownSocketSetTest, AbortiveKill) {
runKillTest(true);
}
}} // namespaces
} // namespace test
} // namespace folly
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment