summaryrefslogtreecommitdiff
path: root/include/multipart_parser.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-06-04 19:06:59 +0300
committerEd Tanous <ed@tanous.net>2022-06-28 17:56:45 +0300
commit8a5928102841d34564c7f3fcd35e64d33638bff1 (patch)
treed02a4e50cddd3e0c427577697f00b3811dc42bc5 /include/multipart_parser.hpp
parent517d9a58b35238ba45ab74812b397e942a9f662a (diff)
downloadbmcweb-8a5928102841d34564c7f3fcd35e64d33638bff1.tar.xz
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 <edtanous@google.com> Change-Id: If703398c2282f9e096ca2694fd94515de36a098b
Diffstat (limited to 'include/multipart_parser.hpp')
-rw-r--r--include/multipart_parser.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/multipart_parser.hpp b/include/multipart_parser.hpp
index 945ebf900e..9d801da979 100644
--- a/include/multipart_parser.hpp
+++ b/include/multipart_parser.hpp
@@ -198,7 +198,7 @@ class MultipartParser
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
c = buffer[i];
}
- processPartData(prevIndex, index, buffer, i, c, state);
+ processPartData(prevIndex, buffer, i, c);
break;
case State::END:
break;
@@ -244,8 +244,8 @@ class MultipartParser
}
}
- void processPartData(size_t& prevIndex, size_t& index, const char* buffer,
- size_t& i, char c, State& state)
+ void processPartData(size_t& prevIndex, const char* buffer, size_t& i,
+ char c)
{
prevIndex = index;