Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Fix some unused variable warnings #13987

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/envoy/registry/registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ template <class Base> class FactoryRegistry : public Logger::Loggable<Logger::Id
auto mapping = std::make_unique<absl::flat_hash_map<std::string, Base*>>();

for (const auto& [factory_name, factory] : factories()) {
UNREFERENCED_PARAMETER(factory_name);
if (factory == nullptr) {
continue;
}
Expand Down
1 change: 1 addition & 0 deletions source/common/config/new_grpc_mux_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void NewGrpcMuxImpl::onDiscoveryResponse(

void NewGrpcMuxImpl::onStreamEstablished() {
for (auto& [type_url, subscription] : subscriptions_) {
UNREFERENCED_PARAMETER(type_url);
subscription->sub_state_.markStreamFresh();
}
trySendDiscoveryRequests();
Expand Down
1 change: 1 addition & 0 deletions source/common/init/manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void ManagerImpl::dumpUnreadyTargets(envoy::admin::v3::UnreadyTargetsDumps& unre
auto& message = *unready_targets_dumps.mutable_unready_targets_dumps()->Add();
message.set_name(name_);
for (const auto& [target_name, count] : target_names_count_) {
UNREFERENCED_PARAMETER(count);
message.add_target_names(target_name);
}
}
Expand Down
1 change: 1 addition & 0 deletions source/common/router/scoped_rds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ ScopedRdsConfigSubscription::detectUpdateConflictAndCleanupRemoved(
absl::flat_hash_map<uint64_t, std::string> scope_name_by_hash = scope_name_by_hash_;
absl::erase_if(scope_name_by_hash, [&updated_or_removed_scopes](const auto& key_name) {
auto const& [key, name] = key_name;
UNREFERENCED_PARAMETER(key);
return updated_or_removed_scopes.contains(name);
});
absl::flat_hash_map<std::string, envoy::config::route::v3::ScopedRouteConfiguration>
Expand Down
3 changes: 3 additions & 0 deletions source/server/admin/config_dump_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ ConfigDumpHandler::addResourceToDump(envoy::admin::v3::ConfigDump& dump,
}

for (const auto& [name, callback] : callbacks_map) {
UNREFERENCED_PARAMETER(name);
ProtobufTypes::MessagePtr message = callback();
ASSERT(message);

Expand Down Expand Up @@ -200,6 +201,7 @@ void ConfigDumpHandler::addAllConfigToDump(envoy::admin::v3::ConfigDump& dump,
}

for (const auto& [name, callback] : callbacks_map) {
UNREFERENCED_PARAMETER(name);
ProtobufTypes::MessagePtr message = callback();
ASSERT(message);

Expand All @@ -220,6 +222,7 @@ ProtobufTypes::MessagePtr ConfigDumpHandler::dumpEndpointConfigs() const {
auto endpoint_config_dump = std::make_unique<envoy::admin::v3::EndpointsConfigDump>();

for (const auto& [name, cluster_ref] : server_.clusterManager().clusters()) {
UNREFERENCED_PARAMETER(name);
const Upstream::Cluster& cluster = cluster_ref.get();
Upstream::ClusterInfoConstSharedPtr cluster_info = cluster.info();
envoy::config::endpoint::v3::ClusterLoadAssignment cluster_load_assignment;
Expand Down
4 changes: 4 additions & 0 deletions source/server/filter_chain_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ const Network::FilterChain* FilterChainManagerImpl::findFilterChainForSourceIpAn

void FilterChainManagerImpl::convertIPsToTries() {
for (auto& [destination_port, destination_ips_pair] : destination_ports_map_) {
UNREFERENCED_PARAMETER(destination_port);
// These variables are used as we build up the destination CIDRs used for the trie.
auto& [destination_ips_map, destination_ips_trie] = destination_ips_pair;
std::vector<std::pair<ServerNamesMapSharedPtr, std::vector<Network::Address::CidrRange>>>
Expand All @@ -613,8 +614,11 @@ void FilterChainManagerImpl::convertIPsToTries() {
// We need to get access to all of the source IP strings so that we can convert them into
// a trie like we did for the destination IPs above.
for (auto& [server_name, transport_protocols_map] : *server_names_map_ptr) {
UNREFERENCED_PARAMETER(server_name);
for (auto& [transport_protocol, application_protocols_map] : transport_protocols_map) {
UNREFERENCED_PARAMETER(transport_protocol);
for (auto& [application_protocol, source_arrays] : application_protocols_map) {
UNREFERENCED_PARAMETER(application_protocol);
for (auto& [source_ips_map, source_ips_trie] : source_arrays) {
std::vector<
std::pair<SourcePortsMapSharedPtr, std::vector<Network::Address::CidrRange>>>
Expand Down