1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-10 21:22:20 +03:00

Add -Wextra-semi compiler flag

Summary: Cleaned up extra semicolons for compatibility with other projects enforcing the flag, included flag in build

Reviewed By: lnicco, JunqiWang

Differential Revision: D21794945

fbshipit-source-id: ae2ee637aadeef35a99d89f9b8deaa2e7d636ed7
This commit is contained in:
Andrii Vasylevskyi
2020-05-30 07:38:18 -07:00
committed by Facebook GitHub Bot
parent f46dff82e2
commit 8e785bbfc2
7 changed files with 23 additions and 23 deletions

View File

@@ -16,49 +16,49 @@ namespace quic {
QuicTransportException::QuicTransportException( QuicTransportException::QuicTransportException(
const std::string& msg, const std::string& msg,
TransportErrorCode errCode) TransportErrorCode errCode)
: std::runtime_error(msg), errCode_(errCode){}; : std::runtime_error(msg), errCode_(errCode) {}
QuicTransportException::QuicTransportException( QuicTransportException::QuicTransportException(
const char* msg, const char* msg,
TransportErrorCode errCode) TransportErrorCode errCode)
: std::runtime_error(msg), errCode_(errCode){}; : std::runtime_error(msg), errCode_(errCode) {}
QuicTransportException::QuicTransportException( QuicTransportException::QuicTransportException(
const std::string& msg, const std::string& msg,
TransportErrorCode errCode, TransportErrorCode errCode,
FrameType frameType) FrameType frameType)
: std::runtime_error(msg), errCode_(errCode), frameType_(frameType){}; : std::runtime_error(msg), errCode_(errCode), frameType_(frameType) {}
QuicTransportException::QuicTransportException( QuicTransportException::QuicTransportException(
const char* msg, const char* msg,
TransportErrorCode errCode, TransportErrorCode errCode,
FrameType frameType) FrameType frameType)
: std::runtime_error(msg), errCode_(errCode), frameType_(frameType){}; : std::runtime_error(msg), errCode_(errCode), frameType_(frameType) {}
QuicInternalException::QuicInternalException( QuicInternalException::QuicInternalException(
const std::string& msg, const std::string& msg,
LocalErrorCode errCode) LocalErrorCode errCode)
: std::runtime_error(msg), errorCode_(errCode){}; : std::runtime_error(msg), errorCode_(errCode) {}
QuicInternalException::QuicInternalException( QuicInternalException::QuicInternalException(
const char* msg, const char* msg,
LocalErrorCode errCode) LocalErrorCode errCode)
: std::runtime_error(msg), errorCode_(errCode){}; : std::runtime_error(msg), errorCode_(errCode) {}
QuicInternalException::QuicInternalException( QuicInternalException::QuicInternalException(
folly::StringPiece msg, folly::StringPiece msg,
LocalErrorCode errCode) LocalErrorCode errCode)
: std::runtime_error(folly::to<std::string>(msg)), errorCode_(errCode){}; : std::runtime_error(folly::to<std::string>(msg)), errorCode_(errCode) {}
QuicApplicationException::QuicApplicationException( QuicApplicationException::QuicApplicationException(
const std::string& msg, const std::string& msg,
ApplicationErrorCode errorCode) ApplicationErrorCode errorCode)
: std::runtime_error(msg), errorCode_(errorCode){}; : std::runtime_error(msg), errorCode_(errorCode) {}
QuicApplicationException::QuicApplicationException( QuicApplicationException::QuicApplicationException(
const char* msg, const char* msg,
ApplicationErrorCode errorCode) ApplicationErrorCode errorCode)
: std::runtime_error(msg), errorCode_(errorCode){}; : std::runtime_error(msg), errorCode_(errorCode) {}
folly::StringPiece toString(LocalErrorCode code) { folly::StringPiece toString(LocalErrorCode code) {
switch (code) { switch (code) {

View File

@@ -167,7 +167,7 @@ class MockQuicTransport : public QuicServerTransport {
virtual ~MockQuicTransport() { virtual ~MockQuicTransport() {
customDestructor(); customDestructor();
}; }
MOCK_METHOD0(customDestructor, void()); MOCK_METHOD0(customDestructor, void());

View File

@@ -72,7 +72,7 @@ folly::Expected<size_t, TransportErrorCode> encodeQuicInteger(
return encodeEightBytes(std::move(bufop), value); return encodeEightBytes(std::move(bufop), value);
} }
return folly::makeUnexpected(TransportErrorCode::INTERNAL_ERROR); return folly::makeUnexpected(TransportErrorCode::INTERNAL_ERROR);
}; }
template <typename BufOp> template <typename BufOp>
folly::Expected<size_t, TransportErrorCode> folly::Expected<size_t, TransportErrorCode>
@@ -92,7 +92,7 @@ encodeQuicInteger(uint64_t value, BufOp bufop, int outputSize) {
return encodeEightBytes(std::move(bufop), value); return encodeEightBytes(std::move(bufop), value);
} }
return folly::makeUnexpected(TransportErrorCode::INTERNAL_ERROR); return folly::makeUnexpected(TransportErrorCode::INTERNAL_ERROR);
}; }
/** /**
* Reads an integer out of the cursor and returns a pair with the integer and * Reads an integer out of the cursor and returns a pair with the integer and
@@ -141,7 +141,7 @@ class QuicInteger {
folly::to<std::string>("Value too large ", value_), size.error()); folly::to<std::string>("Value too large ", value_), size.error());
} }
return size.value(); return size.value();
}; }
template <typename BufOp> template <typename BufOp>
size_t encode(BufOp appender, int outputSize) const { size_t encode(BufOp appender, int outputSize) const {
@@ -152,7 +152,7 @@ class QuicInteger {
folly::to<std::string>("Value too large ", value_), size.error()); folly::to<std::string>("Value too large ", value_), size.error());
} }
return size.value(); return size.value();
}; }
/** /**
* Returns the number of bytes needed to represent the QUIC integer in * Returns the number of bytes needed to represent the QUIC integer in

View File

@@ -388,7 +388,7 @@ class PacketBuilderWrapper : public PacketBuilderInterface {
FOLLY_NODISCARD bool canBuildPacket() const noexcept override { FOLLY_NODISCARD bool canBuildPacket() const noexcept override {
return builder.canBuildPacket(); return builder.canBuildPacket();
}; }
FOLLY_NODISCARD uint32_t getHeaderBytes() const override { FOLLY_NODISCARD uint32_t getHeaderBytes() const override {
return builder.getHeaderBytes(); return builder.getHeaderBytes();

View File

@@ -14,31 +14,31 @@ namespace quic {
std::string getFlowControlEvent(int offset) { std::string getFlowControlEvent(int offset) {
return "flow control event, new offset: " + folly::to<std::string>(offset); return "flow control event, new offset: " + folly::to<std::string>(offset);
}; }
std::string std::string
getRxStreamWU(StreamId streamId, PacketNum packetNum, uint64_t maximumData) { getRxStreamWU(StreamId streamId, PacketNum packetNum, uint64_t maximumData) {
return "rx stream, streamId: " + folly::to<std::string>(streamId) + return "rx stream, streamId: " + folly::to<std::string>(streamId) +
", packetNum: " + folly::to<std::string>(packetNum) + ", packetNum: " + folly::to<std::string>(packetNum) +
", maximumData: " + folly::to<std::string>(maximumData); ", maximumData: " + folly::to<std::string>(maximumData);
}; }
std::string getRxConnWU(PacketNum packetNum, uint64_t maximumData) { std::string getRxConnWU(PacketNum packetNum, uint64_t maximumData) {
return "rx, packetNum: " + folly::to<std::string>(packetNum) + return "rx, packetNum: " + folly::to<std::string>(packetNum) +
", maximumData: " + folly::to<std::string>(maximumData); ", maximumData: " + folly::to<std::string>(maximumData);
}; }
std::string getPeerClose(const std::string& peerCloseReason) { std::string getPeerClose(const std::string& peerCloseReason) {
return "error message: " + peerCloseReason; return "error message: " + peerCloseReason;
}; }
std::string getFlowControlWindowAvailable(uint64_t windowAvailable) { std::string getFlowControlWindowAvailable(uint64_t windowAvailable) {
return "on flow control, window available: " + return "on flow control, window available: " +
folly::to<std::string>(windowAvailable); folly::to<std::string>(windowAvailable);
}; }
std::string getClosingStream(const std::string& streamId) { std::string getClosingStream(const std::string& streamId) {
return "closing stream, stream id: " + streamId; return "closing stream, stream id: " + streamId;
}; }
} // namespace quic } // namespace quic

View File

@@ -15,7 +15,7 @@ namespace quic::test {
class MockQLogger : public QLogger { class MockQLogger : public QLogger {
public: public:
MockQLogger() = delete; MockQLogger() = delete;
MockQLogger(VantagePoint vp) : QLogger(vp, kHTTP3ProtocolType){}; MockQLogger(VantagePoint vp) : QLogger(vp, kHTTP3ProtocolType) {}
~MockQLogger() override = default; ~MockQLogger() override = default;
MOCK_METHOD2(addPacket, void(const RegularQuicPacket&, uint64_t)); MOCK_METHOD2(addPacket, void(const RegularQuicPacket&, uint64_t));
MOCK_METHOD3( MOCK_METHOD3(

View File

@@ -565,7 +565,7 @@ void QuicServer::setEventBaseObserver(
runOnAllWorkers([observer](auto worker) { runOnAllWorkers([observer](auto worker) {
worker->getEventBase()->setObserver(observer); worker->getEventBase()->setObserver(observer);
}); });
}; }
void QuicServer::startPacketForwarding(const folly::SocketAddress& destAddr) { void QuicServer::startPacketForwarding(const folly::SocketAddress& destAddr) {
if (initialized_) { if (initialized_) {