From db8328608a4fa9cc5b77ae65c42968060a2dcf2c Mon Sep 17 00:00:00 2001 From: Amit Dutta Date: Fri, 6 Feb 2026 18:19:35 -0800 Subject: [PATCH] misc(native): Minor warnings fixes Summary: Fix lint warnings identified by clang-tidy in the presto_cpp http/ directory: - Replace C-style cast with static_cast in HttpClient.cpp (HttpResponse::consumeBody) - Remove C-style `(void)` parameter declarations in InternalAuthenticationFilter (use empty parens instead) - Comment out unused parameters in AbstractRequestHandler (onUpgrade, onError) and StatsFilterFactory (onRequest) to suppress -Wunused-parameter warnings Differential Revision: D92586871 --- presto-native-execution/presto_cpp/main/http/HttpClient.cpp | 2 +- presto-native-execution/presto_cpp/main/http/HttpServer.h | 4 ++-- .../main/http/filters/InternalAuthenticationFilter.cpp | 2 +- .../main/http/filters/InternalAuthenticationFilter.h | 4 ++-- .../presto_cpp/main/http/filters/StatsFilter.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/presto-native-execution/presto_cpp/main/http/HttpClient.cpp b/presto-native-execution/presto_cpp/main/http/HttpClient.cpp index 3c951d2217dc1..0a0f208e010ab 100644 --- a/presto-native-execution/presto_cpp/main/http/HttpClient.cpp +++ b/presto-native-execution/presto_cpp/main/http/HttpClient.cpp @@ -149,7 +149,7 @@ std::unique_ptr HttpResponse::consumeBody( for (auto& iobuf : bodyChain_) { const auto length = iobuf->length(); ::memcpy(curr, iobuf->data(), length); - curr = (char*)curr + length; + curr = static_cast(curr) + length; iobuf.reset(); } bodyChain_.clear(); diff --git a/presto-native-execution/presto_cpp/main/http/HttpServer.h b/presto-native-execution/presto_cpp/main/http/HttpServer.h index 32e13029bb5a4..0d9870810a42b 100644 --- a/presto-native-execution/presto_cpp/main/http/HttpServer.h +++ b/presto-native-execution/presto_cpp/main/http/HttpServer.h @@ -63,13 +63,13 @@ class AbstractRequestHandler : public proxygen::RequestHandler { body_.emplace_back(std::move(body)); } - void onUpgrade(proxygen::UpgradeProtocol proto) noexcept override {} + void onUpgrade(proxygen::UpgradeProtocol /*proto*/) noexcept override {} void requestComplete() noexcept override { delete this; } - void onError(proxygen::ProxygenError err) noexcept override { + void onError(proxygen::ProxygenError /*err*/) noexcept override { delete this; } diff --git a/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.cpp b/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.cpp index bea48739e0af1..1e5125abc371b 100644 --- a/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.cpp +++ b/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.cpp @@ -103,7 +103,7 @@ void InternalAuthenticationFilter::onError( delete this; } -void InternalAuthenticationFilter::sendGenericErrorResponse(void) { +void InternalAuthenticationFilter::sendGenericErrorResponse() { /// Indicate to upstream an error occurred and make sure /// no further forwarding occurs. upstream_->onError(proxygen::kErrorUnsupportedExpectation); diff --git a/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.h b/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.h index 5002b285589b8..c403cdfa7dcc7 100644 --- a/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.h +++ b/presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.h @@ -47,9 +47,9 @@ class InternalAuthenticationFilter : public proxygen::Filter { void onError(proxygen::ProxygenError err) noexcept override; private: - void sendGenericErrorResponse(void); + void sendGenericErrorResponse(); - void sendUnauthorizedResponse(void); + void sendUnauthorizedResponse(); void processAndVerifyJwt( const std::string& token, diff --git a/presto-native-execution/presto_cpp/main/http/filters/StatsFilter.h b/presto-native-execution/presto_cpp/main/http/filters/StatsFilter.h index 7696b040b93e8..69b15c5a9f2a7 100644 --- a/presto-native-execution/presto_cpp/main/http/filters/StatsFilter.h +++ b/presto-native-execution/presto_cpp/main/http/filters/StatsFilter.h @@ -46,7 +46,7 @@ class StatsFilterFactory : public proxygen::RequestHandlerFactory { proxygen::RequestHandler* onRequest( proxygen::RequestHandler* handler, - proxygen::HTTPMessage* msg) noexcept override { + proxygen::HTTPMessage* /*msg*/) noexcept override { return new StatsFilter(handler); } };