Skip to content

Commit be28efc

Browse files
yfeldblummeta-codesync[bot]
authored andcommitted
address violations of warning unreachable-code-return
Summary: TSIA. Reviewed By: kwaugh Differential Revision: D95684729 fbshipit-source-id: 192164ea98c7d44eb0ffdcdffd0d7e2c2fec9adb
1 parent 0a950dc commit be28efc

6 files changed

Lines changed: 12 additions & 19 deletions

File tree

third-party/proxygen/src/proxygen/lib/http/codec/DefaultHTTPCodecFactory.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,5 @@ std::unique_ptr<HTTPCodec> DefaultHTTPCodecFactory::getCodec(
6060
// default
6161
return nullptr;
6262
}
63-
// unreachable
64-
return nullptr;
6563
}
6664
} // namespace proxygen

third-party/proxygen/src/proxygen/lib/http/coro/filters/test/TransformFilterTest.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ CO_TEST_F_X(TransformFilterTest, InvokeOnError) {
132132
return std::move(headerEvent);
133133
};
134134
TransformFilter::BodyTransformFn bodyHook =
135-
[](folly::Try<HTTPBodyEvent>&& bodyEvent) {
136-
LOG(FATAL) << "unreachable";
137-
return folly::Try<HTTPBodyEvent>();
138-
};
135+
[](folly::Try<HTTPBodyEvent>&& bodyEvent) -> folly::Try<HTTPBodyEvent> {
136+
LOG(FATAL) << "unreachable";
137+
};
139138

140139
auto* transformSource = new TransformFilter(
141140
respSource, std::move(headerHook), std::move(bodyHook));
@@ -170,9 +169,8 @@ CO_TEST_F_X(TransformFilterTest, TransformBodyToError) {
170169

171170
HTTPSourceReader reader(transformSource);
172171

173-
reader.onBody([](BufQueue body, bool /*eom*/) {
172+
reader.onBody([](BufQueue body, bool /*eom*/) -> bool {
174173
LOG(FATAL) << "shouldn't happen";
175-
return HTTPSourceReader::Continue;
176174
});
177175

178176
// read response

third-party/proxygen/src/proxygen/lib/http/coro/server/test/HTTPServerTest.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,9 @@ TEST_P(HTTPServerTests, TestFilterFailException) {
356356
const folly::AsyncTransportCertificate* /*peerCert*/,
357357
const std::string& /* nextProtocolName */,
358358
SecureTransportType /* secureTransportType */,
359-
const wangle::TransportInfo& /* tinfo */) {
360-
throw std::runtime_error("filter failed this connection");
361-
return true;
362-
};
359+
const wangle::TransportInfo& /* tinfo */) -> bool {
360+
throw std::runtime_error("filter failed this connection");
361+
};
363362
startServer(nullptr, /*expectRequest=*/false);
364363
initClient();
365364

third-party/proxygen/src/proxygen/lib/http/test/HTTPMessageTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,9 +861,8 @@ TEST(HTTPHeaders, MoveFromTest) {
861861
HTTPHeaders h1;
862862
HTTPHeaders h2(std::move(h1));
863863
EXPECT_FALSE(h1.exists(HTTP_HEADER_CONNECTION));
864-
h1.forEachValueOfHeader(HTTP_HEADER_HOST, [](const std::string&) {
864+
h1.forEachValueOfHeader(HTTP_HEADER_HOST, [](const std::string&) -> bool {
865865
CHECK(false) << "Unreachable";
866-
return false;
867866
});
868867
h1.add(HTTP_HEADER_CONNECTION, "close");
869868

third-party/proxygen/src/proxygen/lib/utils/ZlibStreamCompressor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ std::unique_ptr<IOBuf> ZlibStreamCompressor::compress(const IOBuf* in,
123123
while (zlibStream_.avail_in != 0) {
124124
status_ = deflateHelper(&zlibStream_, out.get(), Z_NO_FLUSH);
125125
if (status_ != Z_OK) {
126-
DLOG(FATAL) << "Deflate failed: " << zlibStream_.msg;
126+
LOG(DFATAL) << "Deflate failed: " << zlibStream_.msg;
127127
return nullptr;
128128
}
129129
}
@@ -136,7 +136,7 @@ std::unique_ptr<IOBuf> ZlibStreamCompressor::compress(const IOBuf* in,
136136
} while (status_ == Z_OK);
137137

138138
if (status_ != Z_STREAM_END) {
139-
DLOG(FATAL) << "Deflate failed: " << zlibStream_.msg;
139+
LOG(DFATAL) << "Deflate failed: " << zlibStream_.msg;
140140
return nullptr;
141141
}
142142
} else {
@@ -145,7 +145,7 @@ std::unique_ptr<IOBuf> ZlibStreamCompressor::compress(const IOBuf* in,
145145
} while (zlibStream_.avail_out == 0);
146146

147147
if (status_ != Z_OK) {
148-
DLOG(FATAL) << "Deflate failed: " << zlibStream_.msg;
148+
LOG(DFATAL) << "Deflate failed: " << zlibStream_.msg;
149149
return nullptr;
150150
}
151151
}

third-party/proxygen/src/proxygen/lib/utils/perfect_hash_table_template.cpp.gperf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ const std::string* %%name%%::getPointerToTable(
6767
// Controlled abort here so its clear from a crash stack this method
6868
// was called with a table type for which there is no current
6969
// implementation
70-
CHECK(false);
71-
return nullptr;
70+
LOG(FATAL) << "unknown table type";
7271
}
7372
}
7473

0 commit comments

Comments
 (0)