eolian-cxx: Removed Wshadow warnings.

Summary:
Removes Wshadow warnings by prepending/appending radices to
the target variables and parameters.

Reviewers: felipealmeida

CC: cedric

Differential Revision: https://phab.enlightenment.org/D1118
This commit is contained in:
Savio Sena 2014-07-03 19:35:40 -03:00
parent 380115c025
commit 4e6825d6ac
15 changed files with 56 additions and 54 deletions

View File

@ -236,7 +236,7 @@ property_is_setter(Eolian_Function const& func)
inline std::string
parameter_name(Eolian_Function_Parameter const& parameter)
{
return safe_strshare(::eolian_parameter_name_get(parameter));
return safe_strshare(::eolian_parameter_name_get(parameter)) + "_";
}
inline bool

View File

@ -133,18 +133,18 @@ R _get_return_value(_data<F>& data, _identity<R>)
{
if(!data.exception)
{
R* b = static_cast<R*>(static_cast<void*>(&data.return_buffer.buffer));
R* b_ = static_cast<R*>(static_cast<void*>(&data.return_buffer.buffer));
struct destroy
{
destroy(R* p) : p(p)
destroy(R* x_) : p_(x_)
{}
~destroy()
{
p->~R();
p_->~R();
}
R* p;
} destroy_temp(b);
return std::move(*b);
R* p_;
} destroy_temp(b_);
return std::move(*b_);
}
else
{

View File

@ -84,9 +84,9 @@ struct descriptor
typedef T object_type;
descriptor() : _descriptor(nullptr) {}
descriptor( ::Eet_Data_Descriptor* descriptor
descriptor( ::Eet_Data_Descriptor* descriptor_
, std::array<_detail::member_desc_info, sizeof...(Args)> member_info)
: _descriptor(descriptor), _member_info(member_info)
: _descriptor(descriptor_), _member_info(member_info)
{
}
descriptor(descriptor&& other)

View File

@ -1241,15 +1241,15 @@ public:
{
if(_array->max - _array->len >= n)
{
iterator end = static_cast<T*>(_array->members)
iterator end_ = static_cast<T*>(_array->members)
+ _array->len
, last = end + n;
, last = end_ + n;
_array->len += n;
std::reverse_iterator<iterator>
dest(last), src(end), src_end(i);
dest(last), src(end_), src_end(i);
for(;src != src_end; ++src)
{
if(dest.base() <= end)
if(dest.base() <= end_)
*dest++ = *src;
else
new (&*dest++) T(*src);
@ -1257,7 +1257,7 @@ public:
iterator j = i;
for(size_type k = 0;k != n;++k)
{
if(j < end)
if(j < end_)
*j = t;
else
new (&*j++) T(t);

View File

@ -482,8 +482,8 @@ struct _inlist_common_base
// For EBO
struct _inlist_impl : node_allocator_type
{
_inlist_impl(Allocator allocator)
: node_allocator_type(allocator), _list(0)
_inlist_impl(Allocator allocator_)
: node_allocator_type(allocator_), _list(0)
{}
explicit _inlist_impl(native_handle_type list)
: _list(list)

View File

@ -148,8 +148,8 @@ public:
* This constructor creates an iterator that wraps the given native
* @c Eina_Iterator handle, providing an OOP interface to it.
*/
explicit iterator(Eina_Iterator* iterator = 0)
: base_type(iterator)
explicit iterator(Eina_Iterator* iterator_ = 0)
: base_type(iterator_)
{
if(this->_iterator)
++*this;

View File

@ -703,15 +703,15 @@ public:
{
std::size_t j
= i.native_handle() - this->_impl._array->data
, size = this->size();
, size_ = this->size();
if(eina_array_push(this->_impl._array, p.get()))
{
if(size - j)
if(size_ - j)
{
memmove(
this->_impl._array->data + j + 1
, this->_impl._array->data + j
, (size - j)*sizeof(void*));
, (size_ - j)*sizeof(void*));
// PRE: Q:[j, size) = [j+1, size+1)
pointer* data = static_cast<pointer*>
(static_cast<void*>(this->_impl._array->data));
@ -816,11 +816,11 @@ public:
*/
iterator erase(iterator q)
{
size_type size = this->size()
size_type size_ = this->size()
, i = q.native_handle() - this->_impl._array->data;
memmove(q.native_handle()
, q.native_handle() + 1
, (size - i - 1)*sizeof(void*));
, (size_ - i - 1)*sizeof(void*));
eina_array_pop(this->_impl._array);
return q;
}
@ -840,11 +840,11 @@ public:
*/
iterator erase(iterator i, iterator j)
{
size_type size = this->size()
size_type size_ = this->size()
, distance = std::distance(i, j);
memmove(i.native_handle()
, j.native_handle()
, (size - distance)*sizeof(void*));
, (size_ - distance)*sizeof(void*));
while(distance--)
eina_array_pop(this->_impl._array);
return i;

View File

@ -89,8 +89,8 @@ struct connection
typedef Eldbus_Connection* native_handle_type;
typedef Eldbus_Connection const* const_native_handle_type;
explicit connection(native_handle_type connection)
: _connection(connection) {}
explicit connection(native_handle_type connection_)
: _connection(connection_) {}
~connection()
{
eldbus_connection_unref(_connection);

View File

@ -34,11 +34,11 @@ void _callback_wrapper(void* data, Eldbus_Message const* message, Eldbus_Pending
, tuple, std::integral_constant<bool, (sizeof...(Ins) == 0)>()))
{
std::cout << "error init raw tuple" << std::endl;
std::tuple<Ins...> tuple;
std::tuple<Ins...> tuple_;
eldbus::const_message msg( ::eldbus_message_ref(const_cast<Eldbus_Message*>(message)));
eina::error_code ec(eldbus::signature_mismatch_error_code(), eina::eina_error_category());
eina::call_tuple_unwrap_prefix
(*callback, tuple, eina::make_index_sequence<sizeof...(Ins)>()
(*callback, tuple_, eina::make_index_sequence<sizeof...(Ins)>()
, ec, msg, pending);
}
}

View File

@ -195,7 +195,7 @@ struct message : const_message
{
typedef const_message base_type;
explicit message(Eldbus_Message* message) : const_message(message)
explicit message(Eldbus_Message* message_) : const_message(message_)
{
}
message(const_message const& other, reply_t r)
@ -256,7 +256,7 @@ private:
struct pending : const_pending
{
pending() : const_pending(0) {}
pending(Eldbus_Pending* pending) : const_pending(pending) {}
pending(Eldbus_Pending* pending_) : const_pending(pending_) {}
void data_set(const char* key, const char* data)
{

View File

@ -26,12 +26,12 @@ void _on_call_impl(void* data, Eldbus_Message const* message, Eldbus_Pending* pe
const char* errname, *errmsg;
if (eldbus_message_error_get(message, &errname, &errmsg))
{
Seq tuple;
Seq tuple_;
::eldbus_message_ref(const_cast<Eldbus_Message*>(message));
eldbus::const_message msg(message);
eina::error_code ec (eldbus::call_error_code(), eina::eina_error_category());
eina::call_tuple_unwrap_prefix
(*callback, tuple, eina::make_index_sequence<std::tuple_size<Seq>::value>()
(*callback, tuple_, eina::make_index_sequence<std::tuple_size<Seq>::value>()
, ec, msg, pending);
}
@ -42,12 +42,12 @@ void _on_call_impl(void* data, Eldbus_Message const* message, Eldbus_Pending* pe
(eldbus_message_iter_get(message)
, tuple, std::integral_constant<bool, (std::tuple_size<Seq>::value == 0)>()))
{
Seq tuple;
Seq tuple_;
::eldbus_message_ref(const_cast<Eldbus_Message*>(message));
eldbus::const_message msg(message);
eina::error_code ec(eldbus::signature_mismatch_error_code(), eina::eina_error_category());
eina::call_tuple_unwrap_prefix
(*callback, tuple, eina::make_index_sequence<std::tuple_size<Seq>::value>()
(*callback, tuple_, eina::make_index_sequence<std::tuple_size<Seq>::value>()
, ec, msg, pending);
}
}

View File

@ -48,7 +48,7 @@ struct const_char_type
template <typename... Args>
struct ins
{
ins(typename _detail::const_char_type<Args>::type... names) : _names({names...}) {}
ins(typename _detail::const_char_type<Args>::type... names) : _names({{names...}}) {}
static constexpr std::size_t size() { return sizeof...(Args); }
@ -59,7 +59,7 @@ struct ins
template <typename... Args>
struct outs
{
outs(typename _detail::const_char_type<Args>::type... names) : _names({names...}) {}
outs(typename _detail::const_char_type<Args>::type... names) : _names({{names...}}) {}
static constexpr std::size_t size() { return sizeof...(Args); }
@ -223,9 +223,9 @@ Eldbus_Message* _method_callback_call
std::get<0u>(tuple_outs) =
callable(msg, siface, std::get<IndexIns>(tuple_ins_raw)..., &std::get<IndexOuts2>(tuple_outs)...);
Eldbus_Message *reply = eldbus_message_method_return_new(message);
_detail::_append_tuple<0u>(reply, tuple_outs, std::false_type());
return reply;
Eldbus_Message *reply_ = eldbus_message_method_return_new(message);
_detail::_append_tuple<0u>(reply_, tuple_outs, std::false_type());
return reply_;
}
template <typename Callable, typename... Ins, typename... Outs
@ -254,11 +254,11 @@ Eldbus_Message* _method_callback_call
// and/or outs<...> different from the arguments of your callable
callable(msg, siface, std::get<IndexIns>(tuple_ins_raw)..., &std::get<IndexOuts>(tuple_outs)...);
Eldbus_Message *reply = eldbus_message_method_return_new(message);
Eldbus_Message *reply_ = eldbus_message_method_return_new(message);
_detail::_append_tuple<0u>
(reply, tuple_outs
(reply_, tuple_outs
, std::integral_constant<bool, std::tuple_size<tuple_outs_type>::value == 0u>());
return reply;
return reply_;
}
template <typename Callable, typename Ins, typename Outs>

View File

@ -171,8 +171,8 @@ unsigned int destructors_called = 0u;
struct non_pod
{
non_pod(int x)
: x(new int(x))
non_pod(int x_)
: x(new int(x_))
{
++::constructors_called;
}

View File

@ -253,7 +253,7 @@ START_TEST(eina_cxx_inlist_from_c)
efl::eina::eina_init eina_init;
Eina_Inlist *c_list = nullptr;
Eina_Test_Inlist arr[3] = { {11}, {22}, {33} };
Eina_Test_Inlist arr[] = { {11, {}}, {22, {}}, {33, {}} };
c_list = eina_inlist_append(c_list, EINA_INLIST_GET(&arr[0]));
ck_assert(!!c_list);

View File

@ -10,9 +10,9 @@
#include <check.h>
const char bus[] = "org.Enlightenment";
const char path[] = "/org/enlightenment";
const char interface[] = "org.enlightenment.Test";
const char g_bus[] = "org.Enlightenment";
const char g_path[] = "/org/enlightenment";
const char g_interface[] = "org.enlightenment.Test";
static void
on_name_request(std::error_code const& ec, efl::eldbus::const_message
@ -35,7 +35,7 @@ START_TEST(eldbus_cxx_client)
efl::ecore::ecore_init ecore_init;
edb::eldbus_init init;
edb::connection c(edb::session);
edb::connection c_(edb::session);
namespace es = edb::service;
@ -48,7 +48,7 @@ START_TEST(eldbus_cxx_client)
std::string expected_string = "expected string";
edb::service_interface iface = edb::service_interface_register
(c, path, interface
(c_, g_path, g_interface
, es::method("SendBool"
, [expected_bool] (edb::const_message, edb::service_interface, bool b)
{
@ -160,14 +160,16 @@ START_TEST(eldbus_cxx_client)
, es::outs<std::string, bool>("string", "bool")
)
);
static_cast<void>(iface);
using namespace std::placeholders;
edb::name_request<std::uint32_t>(c, bus, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE
edb::name_request<std::uint32_t>(c_, g_bus, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE
, & ::on_name_request);
std::cout << "registered" << std::endl;
edb::object o = c.get_object(bus, path);
edb::proxy p = o.get_proxy(interface);
edb::object o = c_.get_object(g_bus, g_path);
edb::proxy p = o.get_proxy(g_interface);
using namespace std::placeholders;
p.call<bool>