Skip to content

resolve shadow warnings in gcc (#1) #2

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

Merged
merged 1 commit into from
Oct 12, 2021
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
*.lai
*.la
*.a

# project
.vscode
4 changes: 2 additions & 2 deletions include/async++/aligned_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class aligned_array {
: length(0), ptr(nullptr) {}
aligned_array(std::nullptr_t)
: length(0), ptr(nullptr) {}
explicit aligned_array(std::size_t length)
: length(length)
explicit aligned_array(std::size_t length_)
: length(length_)
{
ptr = static_cast<T*>(aligned_alloc(length * sizeof(T), Align));
std::size_t i;
Expand Down
8 changes: 4 additions & 4 deletions include/async++/continuation_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class compressed_ptr {

public:
compressed_ptr() = default;
compressed_ptr(void* ptr, std::uintptr_t flags)
: ptr(ptr), flags(flags) {}
compressed_ptr(void* ptr_, std::uintptr_t flags_)
: ptr(ptr_), flags(flags_) {}

template<typename T>
T* get_ptr() const
Expand All @@ -62,8 +62,8 @@ class compressed_ptr<Mask, true> {

public:
compressed_ptr() = default;
compressed_ptr(void* ptr, std::uintptr_t flags)
: data(reinterpret_cast<std::uintptr_t>(ptr) | flags) {}
compressed_ptr(void* ptr_, std::uintptr_t flags_)
: data(reinterpret_cast<std::uintptr_t>(ptr_) | flags_) {}

template<typename T>
T* get_ptr() const
Expand Down
8 changes: 4 additions & 4 deletions include/async++/partitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class static_partitioner_impl {
std::size_t grain;

public:
static_partitioner_impl(Iter begin, Iter end, std::size_t grain)
: iter_begin(begin), iter_end(end), grain(grain) {}
static_partitioner_impl(Iter begin_, Iter end_, std::size_t grain_)
: iter_begin(begin_), iter_end(end_), grain(grain_) {}
Iter begin() const
{
return iter_begin;
Expand Down Expand Up @@ -92,8 +92,8 @@ class auto_partitioner_impl {

public:
// thread_id is initialized to "no thread" and will be set on first split
auto_partitioner_impl(Iter begin, Iter end, std::size_t grain)
: iter_begin(begin), iter_end(end), grain(grain) {}
auto_partitioner_impl(Iter begin_, Iter end_, std::size_t grain_)
: iter_begin(begin_), iter_end(end_), grain(grain_) {}
Iter begin() const
{
return iter_begin;
Expand Down
12 changes: 6 additions & 6 deletions include/async++/task_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ struct LIBASYNC_CACHELINE_ALIGN task_base: public ref_count_base<task_base, task
void run_continuations()
{
continuations.flush_and_lock([this](task_ptr t) {
const task_base_vtable* vtable = t->vtable;
vtable->schedule(this, std::move(t));
const task_base_vtable* vtable_ptr = t->vtable;
vtable_ptr->schedule(this, std::move(t));
});
}

Expand Down Expand Up @@ -271,17 +271,17 @@ struct task_result: public task_result_holder<Result> {
}

// Cancel a task with the given exception
void cancel_base(std::exception_ptr&& except)
void cancel_base(std::exception_ptr&& except_)
{
set_exception(std::move(except));
set_exception(std::move(except_));
this->state.store(task_state::canceled, std::memory_order_release);
this->run_continuations();
}

// Set the exception value of the task
void set_exception(std::exception_ptr&& except)
void set_exception(std::exception_ptr&& except_)
{
new(&this->except) std::exception_ptr(std::move(except));
new(&this->except) std::exception_ptr(std::move(except_));
}

// Get the exception a task was canceled with
Expand Down
12 changes: 6 additions & 6 deletions include/async++/when_all_any.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ struct when_all_func_range {
std::size_t index;
ref_count_ptr<when_all_state<Result>> state;

when_all_func_range(std::size_t index, ref_count_ptr<when_all_state<Result>> state)
: index(index), state(std::move(state)) {}
when_all_func_range(std::size_t index_, ref_count_ptr<when_all_state<Result>> state_)
: index(index_), state(std::move(state_)) {}

// Copy the completed task object to the shared state. The event is
// automatically signaled when all references are dropped.
Expand All @@ -72,8 +72,8 @@ template<std::size_t index, typename Task, typename Result>
struct when_all_func_tuple {
ref_count_ptr<when_all_state<Result>> state;

when_all_func_tuple(ref_count_ptr<when_all_state<Result>> state)
: state(std::move(state)) {}
when_all_func_tuple(ref_count_ptr<when_all_state<Result>> state_)
: state(std::move(state_)) {}

// Copy the completed task object to the shared state. The event is
// automatically signaled when all references are dropped.
Expand Down Expand Up @@ -105,8 +105,8 @@ struct when_any_func {
std::size_t index;
ref_count_ptr<when_any_state<Result>> state;

when_any_func(std::size_t index, ref_count_ptr<when_any_state<Result>> state)
: index(index), state(std::move(state)) {}
when_any_func(std::size_t index_, ref_count_ptr<when_any_state<Result>> state_)
: index(index_), state(std::move(state_)) {}

// Simply tell the state that our task has finished, it already has a copy
// of the task object.
Expand Down