cxx: Fix some warnings from -Wextra

Summary:
- As we don't have C++17's [[fallthrough]], rely on GCC'd detection
  of fallthrough comments.

See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

- Add some missing copy assignment operators as reported by
  -Wdeprecated-copy

- Cast a Eina_Bool/bool narrowing conversion

Reviewers: zmike, brunobelo, felipealmeida

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9934
This commit is contained in:
Lauro Moura 2019-09-16 12:41:37 -04:00 committed by Mike Blumenkrantz
parent 22b329d2f4
commit bdb8505f3b
5 changed files with 31 additions and 2 deletions

View File

@ -107,6 +107,21 @@ struct _inlist_iterator
_inlist_iterator(_inlist_iterator<typename std::remove_const<T>::type> const& other)
: _list(other._list), _node(other._node) {}
/**
* @brief Copy assignment operator.
* @param other Other iterator being copied
* @return Copy of the iterator
*/
_inlist_iterator<T> & operator=(_inlist_iterator<typename std::remove_const<T>::type> const& other)
{
if (this != &other)
{
_list = other._list;
_node = other._node;
}
return *this;
}
/**
* @brief Move the iterator to the next position in the list.
* @return The iterator itself.

View File

@ -50,6 +50,12 @@ struct _ptr_array_iterator
: _ptr(other._ptr)
{
}
_ptr_array_iterator<T>& operator=(_ptr_array_iterator<typename remove_cv<value_type>::type> const& other)
{
if (this != &other)
_ptr = other._ptr;
return *this;
}
_ptr_array_iterator<T>& operator++()
{
++_ptr;

View File

@ -67,6 +67,13 @@ struct _ptr_list_iterator : _ptr_list_iterator_base
{
}
_ptr_list_iterator<value_type>& operator=(_ptr_list_iterator<value_type> const &other)
{
if (this != &other)
_ptr_list_iterator_base::operator=(other);
return *this;
}
_ptr_list_iterator<T>& operator++()
{
_node = eina_list_next(_node);

View File

@ -26,7 +26,8 @@ struct html_escaped_string_generator
case '\'': out.append("&apos;"); break;
case '<': out.append("&lt;"); break;
case '>': out.append("&gt;"); break;
case '\\': if (pos < input.size() - 1) pos++; // Deliberate fallthrough
case '\\': if (pos < input.size() - 1) pos++;
// fall through
default: out.append(&input[pos], 1); break;
}
}

View File

@ -492,7 +492,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni
complex.subtypes.push_back({stp
, unit
, ::eolian_type_c_type_get(stp)
, eolian_type_is_move(stp)
, (bool)eolian_type_is_move(stp)
, is_by::value});
stp = eolian_type_next_type_get(stp);
}