summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-22 20:35:18 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 10:14:03 +0900
commit4fdc5fd0b20bf9c56248858fb31aa02cad306e77 (patch)
tree2abffabf1c90265c41f101537d0fadf2d39e835d /src/bin
parentd887c4de52ed74b33850ece7ca9ad6477aa48712 (diff)
cxx: Fix some pedantic warnings from clang
Shadow variables, 0 used as nullptr. clang still complains that usage() is not declared as noreturn.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_cxx/eolian_cxx.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index b67d0442b9..29c81d32d7 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -41,7 +41,7 @@ struct options_type
41 options_type() : main_header(false) {} 41 options_type() : main_header(false) {}
42}; 42};
43 43
44efl::eina::log_domain domain("eolian_cxx"); 44static efl::eina::log_domain domain("eolian_cxx");
45 45
46static bool 46static bool
47opts_check(eolian_cxx::options_type const& opts) 47opts_check(eolian_cxx::options_type const& opts)
@@ -85,11 +85,11 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
85 auto klass_name_function 85 auto klass_name_function
86 = [&] (efl::eolian::grammar::attributes::klass_name const& name) 86 = [&] (efl::eolian::grammar::attributes::klass_name const& name)
87 { 87 {
88 Eolian_Class const* klass = get_klass(name, opts.unit); 88 Eolian_Class const* klass2 = get_klass(name, opts.unit);
89 assert(klass); 89 assert(klass2);
90 c_headers.insert(eolian_class_file_get(klass) + std::string(".h")); 90 c_headers.insert(eolian_class_file_get(klass2) + std::string(".h"));
91 cpp_headers.insert(eolian_class_file_get(klass) + std::string(".hh")); 91 cpp_headers.insert(eolian_class_file_get(klass2) + std::string(".hh"));
92 efl::eolian::grammar::attributes::klass_def cls{klass, opts.unit}; 92 efl::eolian::grammar::attributes::klass_def cls{klass2, opts.unit};
93 if(std::find(forward_klasses.begin(), forward_klasses.end(), cls) == forward_klasses.end()) 93 if(std::find(forward_klasses.begin(), forward_klasses.end(), cls) == forward_klasses.end())
94 forward_klasses.push_back(cls); 94 forward_klasses.push_back(cls);
95 }; 95 };
@@ -114,23 +114,23 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
114 }; 114 };
115 115
116 std::function<void(Eolian_Class const*)> klass_function 116 std::function<void(Eolian_Class const*)> klass_function
117 = [&] (Eolian_Class const* klass) 117 = [&] (Eolian_Class const* klass2)
118 { 118 {
119 for(efl::eina::iterator<Eolian_Class const> inherit_iterator ( ::eolian_class_inherits_get(klass)) 119 for(efl::eina::iterator<Eolian_Class const> inherit_iterator ( ::eolian_class_inherits_get(klass2))
120 , inherit_last; inherit_iterator != inherit_last; ++inherit_iterator) 120 , inherit_last; inherit_iterator != inherit_last; ++inherit_iterator)
121 { 121 {
122 Eolian_Class const* inherit = &*inherit_iterator; 122 Eolian_Class const* inherit = &*inherit_iterator;
123 c_headers.insert(eolian_class_file_get(inherit) + std::string(".h")); 123 c_headers.insert(eolian_class_file_get(inherit) + std::string(".h"));
124 cpp_headers.insert(eolian_class_file_get(inherit) + std::string(".hh")); 124 cpp_headers.insert(eolian_class_file_get(inherit) + std::string(".hh"));
125 efl::eolian::grammar::attributes::klass_def klass{inherit, opts.unit}; 125 efl::eolian::grammar::attributes::klass_def klass3{inherit, opts.unit};
126 if(std::find(forward_klasses.begin(), forward_klasses.end(), klass) == forward_klasses.end()) 126 if(std::find(forward_klasses.begin(), forward_klasses.end(), klass3) == forward_klasses.end())
127 forward_klasses.push_back(klass); 127 forward_klasses.push_back(klass3);
128 128
129 klass_function(inherit); 129 klass_function(inherit);
130 } 130 }
131 131
132 efl::eolian::grammar::attributes::klass_def klass_def(klass, opts.unit); 132 efl::eolian::grammar::attributes::klass_def klass2_def(klass2, opts.unit);
133 for(auto&& f : klass_def.functions) 133 for(auto&& f : klass2_def.functions)
134 { 134 {
135 variant_function(f.return_type); 135 variant_function(f.return_type);
136 for(auto&& p : f.parameters) 136 for(auto&& p : f.parameters)
@@ -138,7 +138,7 @@ generate(const Eolian_Class* klass, eolian_cxx::options_type const& opts,
138 variant_function(p.type); 138 variant_function(p.type);
139 } 139 }
140 } 140 }
141 for(auto&& e : klass_def.events) 141 for(auto&& e : klass2_def.events)
142 { 142 {
143 if(e.type) 143 if(e.type)
144 variant_function(*e.type); 144 variant_function(*e.type);
@@ -463,12 +463,12 @@ opts_get(int argc, char **argv)
463 463
464 const struct option long_options[] = 464 const struct option long_options[] =
465 { 465 {
466 { "in", required_argument, 0, 'I' }, 466 { "in", required_argument, nullptr, 'I' },
467 { "out-file", required_argument, 0, 'o' }, 467 { "out-file", required_argument, nullptr, 'o' },
468 { "version", no_argument, 0, 'v' }, 468 { "version", no_argument, nullptr, 'v' },
469 { "help", no_argument, 0, 'h' }, 469 { "help", no_argument, nullptr, 'h' },
470 { "main-header", no_argument, 0, 'm' }, 470 { "main-header", no_argument, nullptr, 'm' },
471 { 0, 0, 0, 0 } 471 { nullptr, 0, nullptr, 0 }
472 }; 472 };
473 const char* options = "I:D:o:c::marvh"; 473 const char* options = "I:D:o:c::marvh";
474 474