summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx/grammar
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-09-23 13:33:52 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-09-23 13:58:01 -0300
commit03da60997e76d1604b4554e60866283591b98e0d (patch)
tree7f59041944bdf288f9e4d3bf4fed2d7ee9446b82 /src/lib/eolian_cxx/grammar
parent883ef612b771d44c6170f05655de723fa3a2e9e5 (diff)
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/ - Replaced some copy constructors with typecast operators. Previously, a constructor with remove_const/remove_cv were used to allow const iterators to be constructed from non-const iterators. This had the side effect of making these constructors actual copy constructors for non const lists. As we did not define other special constructors/operators, the rule of 5 were violated for these cases. This commit replaces these constructors with actual typecast operators that promote non const iterators to their const counterparts. - Cast a Eina_Bool/bool narrowing conversion - Add a missing break statement from D10050 Reviewers: zmike, brunobelo, felipealmeida Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9934
Diffstat (limited to '')
-rw-r--r--src/lib/eolian_cxx/grammar/html_escaped_string.hpp3
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/eolian_cxx/grammar/html_escaped_string.hpp b/src/lib/eolian_cxx/grammar/html_escaped_string.hpp
index 371afcda24..5bbad79c0f 100644
--- a/src/lib/eolian_cxx/grammar/html_escaped_string.hpp
+++ b/src/lib/eolian_cxx/grammar/html_escaped_string.hpp
@@ -26,7 +26,8 @@ struct html_escaped_string_generator
26 case '\'': out.append("&apos;"); break; 26 case '\'': out.append("&apos;"); break;
27 case '<': out.append("&lt;"); break; 27 case '<': out.append("&lt;"); break;
28 case '>': out.append("&gt;"); break; 28 case '>': out.append("&gt;"); break;
29 case '\\': if (pos < input.size() - 1) pos++; // Deliberate fallthrough 29 case '\\': if (pos < input.size() - 1) pos++;
30 // fall through
30 default: out.append(&input[pos], 1); break; 31 default: out.append(&input[pos], 1); break;
31 } 32 }
32 } 33 }
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index b1f6c383a3..a7a01cc243 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -495,7 +495,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni
495 complex.subtypes.push_back({stp 495 complex.subtypes.push_back({stp
496 , unit 496 , unit
497 , ::eolian_type_c_type_get(stp) 497 , ::eolian_type_c_type_get(stp)
498 , eolian_type_is_move(stp) 498 , static_cast<bool>(eolian_type_is_move(stp))
499 , is_by::value}); 499 , is_by::value});
500 stp = eolian_type_next_type_get(stp); 500 stp = eolian_type_next_type_get(stp);
501 } 501 }
@@ -532,6 +532,7 @@ inline void type_def::set(Eolian_Expression_Type eolian_exp_type)
532 break; 532 break;
533 case EOLIAN_EXPR_STRING: 533 case EOLIAN_EXPR_STRING:
534 set("string", "const char *"); 534 set("string", "const char *");
535 break;
535 case EOLIAN_EXPR_BOOL: 536 case EOLIAN_EXPR_BOOL:
536 set("bool", "Eina_Bool"); 537 set("bool", "Eina_Bool");
537 break; 538 break;