Fix shadow variable warnings with g++ 4.6.

This commit is contained in:
Christopher Kohlhoff 2011-03-22 09:53:46 +11:00
parent 44add4d206
commit bdc4559377
14 changed files with 27 additions and 24 deletions

View File

@ -65,7 +65,7 @@ public:
// Recreate internal descriptors following a fork.
ASIO_DECL void fork_service(
asio::io_service::fork_event event);
asio::io_service::fork_event fork_ev);
// Initialise the task.
ASIO_DECL void init_task();

View File

@ -72,7 +72,7 @@ public:
// Recreate internal descriptors following a fork.
ASIO_DECL void fork_service(
asio::io_service::fork_event event);
asio::io_service::fork_event fork_ev);
// Initialise the task.
ASIO_DECL void init_task();

View File

@ -86,9 +86,9 @@ private:
short events_;
};
void dev_poll_reactor::fork_service(asio::io_service::fork_event event)
void dev_poll_reactor::fork_service(asio::io_service::fork_event fork_ev)
{
if (event == asio::io_service::fork_child)
if (fork_ev == asio::io_service::fork_child)
{
detail::mutex::scoped_lock lock(mutex_);

View File

@ -86,9 +86,9 @@ void epoll_reactor::shutdown_service()
timer_queues_.get_all_timers(ops);
}
void epoll_reactor::fork_service(asio::io_service::fork_event event)
void epoll_reactor::fork_service(asio::io_service::fork_event fork_ev)
{
if (event == asio::io_service::fork_child)
if (fork_ev == asio::io_service::fork_child)
{
if (epoll_fd_ != -1)
::close(epoll_fd_);

View File

@ -76,9 +76,9 @@ void kqueue_reactor::shutdown_service()
timer_queues_.get_all_timers(ops);
}
void kqueue_reactor::fork_service(asio::io_service::fork_event event)
void kqueue_reactor::fork_service(asio::io_service::fork_event fork_ev)
{
if (event == asio::io_service::fork_child)
if (fork_ev == asio::io_service::fork_child)
{
// The kqueue descriptor is automatically closed in the child.
kqueue_fd_ = -1;

View File

@ -65,11 +65,11 @@ void resolver_service_base::shutdown_service()
}
void resolver_service_base::fork_service(
asio::io_service::fork_event event)
asio::io_service::fork_event fork_ev)
{
if (work_thread_.get())
{
if (event == asio::io_service::fork_prepare)
if (fork_ev == asio::io_service::fork_prepare)
{
work_io_service_->stop();
work_thread_->join();

View File

@ -83,9 +83,9 @@ void select_reactor::shutdown_service()
timer_queues_.get_all_timers(ops);
}
void select_reactor::fork_service(asio::io_service::fork_event event)
void select_reactor::fork_service(asio::io_service::fork_event fork_ev)
{
if (event == asio::io_service::fork_child)
if (fork_ev == asio::io_service::fork_child)
interrupter_.recreate();
}

View File

@ -52,7 +52,7 @@ service_registry::~service_registry()
}
}
void service_registry::notify_fork(asio::io_service::fork_event event)
void service_registry::notify_fork(asio::io_service::fork_event fork_ev)
{
// Make a copy of all of the services while holding the lock. We don't want
// to hold the lock while calling into each service, as it may try to call
@ -73,12 +73,12 @@ void service_registry::notify_fork(asio::io_service::fork_event event)
// services in the vector. For the other events we want to go in the other
// direction.
std::size_t num_services = services.size();
if (event == asio::io_service::fork_prepare)
if (fork_ev == asio::io_service::fork_prepare)
for (std::size_t i = 0; i < num_services; ++i)
services[i]->fork_service(event);
services[i]->fork_service(fork_ev);
else
for (std::size_t i = num_services; i > 0; --i)
services[i - 1]->fork_service(event);
services[i - 1]->fork_service(fork_ev);
}
void service_registry::init_key(asio::io_service::service::key& key,

View File

@ -145,13 +145,14 @@ void signal_set_service::shutdown_service()
}
}
void signal_set_service::fork_service(asio::io_service::fork_event event)
void signal_set_service::fork_service(
asio::io_service::fork_event fork_ev)
{
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
signal_state* state = get_signal_state();
static_mutex::scoped_lock lock(state->mutex_);
switch (event)
switch (fork_ev)
{
case asio::io_service::fork_prepare:
reactor_.deregister_internal_descriptor(
@ -178,7 +179,7 @@ void signal_set_service::fork_service(asio::io_service::fork_event event)
break;
}
#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
(void)event;
(void)fork_ev;
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
}

View File

@ -83,7 +83,7 @@ public:
// Recreate internal descriptors following a fork.
ASIO_DECL void fork_service(
asio::io_service::fork_event event);
asio::io_service::fork_event fork_ev);
// Initialise the task.
ASIO_DECL void init_task();

View File

@ -48,7 +48,8 @@ public:
ASIO_DECL void shutdown_service();
// Perform any fork-related housekeeping.
ASIO_DECL void fork_service(asio::io_service::fork_event event);
ASIO_DECL void fork_service(
asio::io_service::fork_event fork_ev);
// Construct a new resolver implementation.
ASIO_DECL void construct(implementation_type& impl);

View File

@ -74,7 +74,7 @@ public:
// Recreate internal descriptors following a fork.
ASIO_DECL void fork_service(
asio::io_service::fork_event event);
asio::io_service::fork_event fork_ev);
// Initialise the task, but only if the reactor is not in its own thread.
ASIO_DECL void init_task();

View File

@ -58,7 +58,7 @@ public:
ASIO_DECL ~service_registry();
// Notify all services of a fork event.
ASIO_DECL void notify_fork(asio::io_service::fork_event event);
ASIO_DECL void notify_fork(asio::io_service::fork_event fork_ev);
// Get the service object corresponding to the specified service type. Will
// create a new service object automatically if no such object already

View File

@ -116,7 +116,8 @@ public:
ASIO_DECL void shutdown_service();
// Perform fork-related housekeeping.
ASIO_DECL void fork_service(asio::io_service::fork_event event);
ASIO_DECL void fork_service(
asio::io_service::fork_event fork_ev);
// Construct a new signal_set implementation.
ASIO_DECL void construct(implementation_type& impl);