From 8a5928102841d34564c7f3fcd35e64d33638bff1 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Sat, 4 Jun 2022 09:06:59 -0700 Subject: Fix shadowed variable issues This patchset is the conclusion of a multi-year effort to try to fix shadowed variable names. Variables seem to be shadowed all over, and in most places they exist, there's a "code smell" of things that aren't doing what the author intended. This commit attempts to clean up these in several ways by: 1. Renaming variables where appropriate. 2. Preferring to refer to member variables directly when operating within a class 3. Rearranging code so that pass through variables are handled in the calling scope, rather than passing them through. These patterns are applied throughout the codebase, to the point where -Wshadow can be enabled in meson.build. Tested: Code compiles, unit tests pass. Still need to run redfish service validator. Signed-off-by: Ed Tanous Change-Id: If703398c2282f9e096ca2694fd94515de36a098b --- http/http_server.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'http/http_server.hpp') diff --git a/http/http_server.hpp b/http/http_server.hpp index a0ccc09c5a..050a3f000e 100644 --- a/http/http_server.hpp +++ b/http/http_server.hpp @@ -30,34 +30,34 @@ class Server public: Server(Handler* handlerIn, std::unique_ptr&& acceptorIn, - std::shared_ptr adaptorCtx, + std::shared_ptr adaptorCtxIn, std::shared_ptr io = std::make_shared()) : ioService(std::move(io)), acceptor(std::move(acceptorIn)), signals(*ioService, SIGINT, SIGTERM, SIGHUP), handler(handlerIn), - adaptorCtx(std::move(adaptorCtx)) + adaptorCtx(std::move(adaptorCtxIn)) {} Server(Handler* handlerIn, const std::string& bindaddr, uint16_t port, - const std::shared_ptr& adaptorCtx, + const std::shared_ptr& adaptorCtxIn, const std::shared_ptr& io = std::make_shared()) : Server(handlerIn, std::make_unique( *io, boost::asio::ip::tcp::endpoint( boost::asio::ip::make_address(bindaddr), port)), - adaptorCtx, io) + adaptorCtxIn, io) {} Server(Handler* handlerIn, int existingSocket, - const std::shared_ptr& adaptorCtx, + const std::shared_ptr& adaptorCtxIn, const std::shared_ptr& io = std::make_shared()) : Server(handlerIn, std::make_unique( *io, boost::asio::ip::tcp::v6(), existingSocket), - adaptorCtx, io) + adaptorCtxIn, io) {} void updateDateStr() -- cgit v1.2.3