From f73593a4034d9eec0ec4466b8e173d4a4daece1f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Dec 2024 19:41:53 +0000 Subject: Drop usage of macro APT_OVERRIDE for simple override We were rather inconsistent in using it and as our public headers contain deduction guides (a c++17 feature) it seems silly to try to hide a c++11 feature in a macro, so lets stop this charade and drop the macro and while we are changing all these lines lets apply [[nodiscard]] (another c++17 feature) and other suggestions from clang-tidy and formatting for a little more consistency. --- methods/http.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'methods/http.h') diff --git a/methods/http.h b/methods/http.h index 5bfcbc8a2..5d6a8aad1 100644 --- a/methods/http.h +++ b/methods/http.h @@ -98,37 +98,37 @@ struct HttpServerState final : public ServerState std::unique_ptr ServerFd; protected: - virtual bool ReadHeaderLines(std::string &Data) APT_OVERRIDE; - virtual ResultState LoadNextResponse(bool const ToFile, RequestState &Req) APT_OVERRIDE; - virtual bool WriteResponse(std::string const &Data) APT_OVERRIDE; + bool ReadHeaderLines(std::string &Data) override; + ResultState LoadNextResponse(bool ToFile, RequestState &Req) override; + bool WriteResponse(std::string const &Data) override; public: - virtual void Reset() APT_OVERRIDE; + void Reset() override; - virtual ResultState RunData(RequestState &Req) APT_OVERRIDE; - virtual ResultState RunDataToDevNull(RequestState &Req) APT_OVERRIDE; + ResultState RunData(RequestState &Req) override; + ResultState RunDataToDevNull(RequestState &Req) override; - virtual ResultState Open() APT_OVERRIDE; - virtual bool IsOpen() APT_OVERRIDE; - virtual bool Close() APT_OVERRIDE; - virtual bool InitHashes(HashStringList const &ExpectedHashes) APT_OVERRIDE; - virtual Hashes * GetHashes() APT_OVERRIDE; - virtual ResultState Die(RequestState &Req) APT_OVERRIDE; - virtual bool Flush(FileFd *const File, bool MustComplete = true) APT_OVERRIDE; - virtual ResultState Go(bool ToFile, RequestState &Req) APT_OVERRIDE; + ResultState Open() override; + bool IsOpen() override; + bool Close() override; + bool InitHashes(HashStringList const &ExpectedHashes) override; + Hashes * GetHashes() override; + ResultState Die(RequestState &Req) override; + bool Flush(FileFd *File, bool MustComplete = true) override; + ResultState Go(bool ToFile, RequestState &Req) override; HttpServerState(URI Srv, HttpMethod *Owner); - virtual ~HttpServerState() {Close();}; + ~HttpServerState() override {Close();}; }; class HttpMethod final : public BaseHttpMethod { public: - virtual void SendReq(FetchItem *Itm) APT_OVERRIDE; + void SendReq(FetchItem *Itm) override; - virtual std::unique_ptr CreateServerState(URI const &uri) APT_OVERRIDE; - virtual void RotateDNS() APT_OVERRIDE; - virtual DealWithHeadersResult DealWithHeaders(FetchResult &Res, RequestState &Req) APT_OVERRIDE; + std::unique_ptr CreateServerState(URI const &uri) override; + void RotateDNS() override; + DealWithHeadersResult DealWithHeaders(FetchResult &Res, RequestState &Req) override; protected: std::string AutoDetectProxyCmd; -- cgit v1.2.3-70-g09d2