>From eed5b04611276d52417543b6079a737d1f4f6d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= Date: Fri, 4 Nov 2016 23:48:35 -0400 Subject: [PATCH 2/3] Fix -Wshadow warnings --- src/common/nmv-log-stream.h | 4 ++-- src/common/nmv-str-utils.cc | 8 ++++---- src/dbgengine/nmv-gdb-engine.cc | 16 ++++++++-------- src/dbgengine/nmv-gdbmi-parser.cc | 12 ++++++------ src/langs/nmv-cpp-parser.cc | 4 ++-- src/persp/dbgperspective/nmv-dbg-perspective.cc | 17 ++++++++--------- src/persp/dbgperspective/nmv-expr-inspector.cc | 14 +++++++------- src/persp/dbgperspective/nmv-expr-monitor.cc | 4 ++-- src/uicommon/nmv-source-editor.cc | 12 +++++------- 9 files changed, 44 insertions(+), 47 deletions(-) diff --git a/src/common/nmv-log-stream.h b/src/common/nmv-log-stream.h index 6f26144..b89206c 100644 --- a/src/common/nmv-log-stream.h +++ b/src/common/nmv-log-stream.h @@ -38,8 +38,8 @@ #ifndef NMV_DEFAULT_DOMAIN #define NMV_DEFAULT_DOMAIN __extension__ \ ({ \ - const char* path = __FILE__; \ - Glib::path_get_basename (path); \ + const char* s_f_path = __FILE__; \ + Glib::path_get_basename (s_f_path); \ }) #endif diff --git a/src/common/nmv-str-utils.cc b/src/common/nmv-str-utils.cc index 725dc5b..e229cb5 100644 --- a/src/common/nmv-str-utils.cc +++ b/src/common/nmv-str-utils.cc @@ -82,11 +82,11 @@ parse_string_colon_number (const std::string &a_str, if (is_number && number_is_at_end_of_str) { string file_name, line_num; - for (string::size_type i = 0; i < str_len; ++i) - a_resulting_string.push_back (a_str[i]); + for (string::size_type j = 0; j < str_len; ++j) + a_resulting_string.push_back (a_str[j]); - for (string::size_type i = colon_pos + 1; i < a_str.length (); ++i) - a_number.push_back (a_str[i]); + for (string::size_type j = colon_pos + 1; j < a_str.length (); ++j) + a_number.push_back (a_str[j]); result = true; } else { // Bail out because the ':' is either not a legit number or diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc index eb4cd94..c5707ac 100644 --- a/src/dbgengine/nmv-gdb-engine.cc +++ b/src/dbgengine/nmv-gdb-engine.cc @@ -884,21 +884,21 @@ public: { LOG_FUNCTION_SCOPE_NORMAL_DD; - vector argv; + vector core_argv; // if the executable program to be debugged is a libtool wrapper script, // run the debugging session under libtool if (is_libtool_executable_wrapper (a_prog_path)) { LOG_DD (a_prog_path << " is a libtool wrapper. "); - argv.push_back ("libtool"); - argv.push_back ("--mode=execute"); + core_argv.push_back ("libtool"); + core_argv.push_back ("--mode=execute"); } - argv.push_back (env::get_gdb_program ()); - argv.push_back ("--interpreter=mi2"); - argv.push_back (a_prog_path); - argv.push_back (a_core_path); - return launch_gdb_real (argv); + core_argv.push_back (env::get_gdb_program ()); + core_argv.push_back ("--interpreter=mi2"); + core_argv.push_back (a_prog_path); + core_argv.push_back (a_core_path); + return launch_gdb_real (core_argv); } bool issue_command (const Command &a_command, diff --git a/src/dbgengine/nmv-gdbmi-parser.cc b/src/dbgengine/nmv-gdbmi-parser.cc index 13dce77..ab55b5c 100644 --- a/src/dbgengine/nmv-gdbmi-parser.cc +++ b/src/dbgengine/nmv-gdbmi-parser.cc @@ -2086,12 +2086,12 @@ fetch_gdbmi_result: PREFIX_VARIABLE_FORMAT)) { IDebugger::Variable::Format format = IDebugger::Variable::UNDEFINED_FORMAT; - UString value; - if (parse_variable_format (cur, cur, format, value)) { + UString fmt_value; + if (parse_variable_format (cur, cur, format, fmt_value)) { result_record.variable_format (format); - if (!value.empty ()) { + if (!fmt_value.empty ()) { IDebugger::VariableSafePtr var (new IDebugger::Variable); - var->value (value); + var->value (fmt_value); result_record.variable_value (var); } } else { @@ -3553,8 +3553,8 @@ GDBMIParser::parse_var_list_children "the GDBMI variable " << NUMCHILD); return false; } - UString s = result->value ()->get_string_content (); - unsigned num_children = s.empty () ? 0 : atoi (s.c_str ()); + UString num_s = result->value ()->get_string_content (); + unsigned num_children = num_s.empty () ? 0 : atoi (num_s.c_str ()); if (!num_children) { LOG_D ("Variable has zero children", diff --git a/src/langs/nmv-cpp-parser.cc b/src/langs/nmv-cpp-parser.cc index 52c8c5b..37d8d8a 100644 --- a/src/langs/nmv-cpp-parser.cc +++ b/src/langs/nmv-cpp-parser.cc @@ -1946,8 +1946,8 @@ Parser::parse_declarator_id (IDDeclaratorPtr &a_result) } parse_nested_name_specifier (scope); if (parse_type_name (type_name)) { - IDExprPtr id_expr (new QualifiedIDExpr (scope, type_name)); - result.reset (new IDDeclarator (id_expr)); + IDExprPtr qualified_id_expr (new QualifiedIDExpr (scope, type_name)); + result.reset (new IDDeclarator (qualified_id_expr)); goto okay; } diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc index 40cf32a..9671c8e 100644 --- a/src/persp/dbgperspective/nmv-dbg-perspective.cc +++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc @@ -1948,10 +1948,10 @@ DBGPerspective::on_motion_notify_event_signal (GdkEventMotion *a_event) if (m_priv->popup_tip && m_priv->popup_tip->get_display ()) { // Mouse pointer coordinates relative to the root window - int x = 0, y = 0; + int x2 = 0, y2 = 0; m_priv->popup_tip->get_display ()->get_device_manager - ()->get_client_pointer ()->get_position (x, y); - hide_popup_tip_if_mouse_is_outside (x, y); + ()->get_client_pointer ()->get_position (x2, y2); + hide_popup_tip_if_mouse_is_outside (x2, y2); } NEMIVER_CATCH; @@ -5373,7 +5373,6 @@ DBGPerspective::create_source_editor (Glib::RefPtr &a_source_buf, NEMIVER_TRY SourceEditor *source_editor; - Gtk::TextIter cur_line_iter; int current_line = -1; if (a_asm_view) { @@ -7008,11 +7007,11 @@ DBGPerspective::append_breakpoint (const IDebugger::Breakpoint &a_breakpoint) UString file_path; file_path = a_breakpoint.file_full_name (); - IDebugger::Breakpoint::Type type = a_breakpoint.type (); + IDebugger::Breakpoint::Type bp_type = a_breakpoint.type (); SourceEditor *editor = 0; - if ((type == IDebugger::Breakpoint::STANDARD_BREAKPOINT_TYPE - || type == IDebugger::Breakpoint::COUNTPOINT_TYPE) + if ((bp_type == IDebugger::Breakpoint::STANDARD_BREAKPOINT_TYPE + || bp_type == IDebugger::Breakpoint::COUNTPOINT_TYPE) && file_path.empty ()) { file_path = a_breakpoint.file_name (); } @@ -7023,8 +7022,8 @@ DBGPerspective::append_breakpoint (const IDebugger::Breakpoint &a_breakpoint) if (// We don't know how to graphically represent non-standard // breakpoints (e.g watchpoints) at this moment, so let's not // bother trying to graphically represent them. - (type != IDebugger::Breakpoint::STANDARD_BREAKPOINT_TYPE - && type != IDebugger::Breakpoint::COUNTPOINT_TYPE) + (bp_type != IDebugger::Breakpoint::STANDARD_BREAKPOINT_TYPE + && bp_type != IDebugger::Breakpoint::COUNTPOINT_TYPE) // Let's not bother trying to to graphically represent a // pending breakpoint, either. || a_breakpoint.is_pending ()) diff --git a/src/persp/dbgperspective/nmv-expr-inspector.cc b/src/persp/dbgperspective/nmv-expr-inspector.cc index 77bb197..0afcfbf 100644 --- a/src/persp/dbgperspective/nmv-expr-inspector.cc +++ b/src/persp/dbgperspective/nmv-expr-inspector.cc @@ -63,7 +63,7 @@ class ExprInspector::Priv : public sigc::trackable { IDebugger &debugger; // Variable that is being inspected // at a given point in time - IDebugger::VariableSafePtr variable; + IDebugger::VariableSafePtr variable_; IPerspective &perspective; VarsTreeView *tree_view; Glib::RefPtr tree_store; @@ -192,7 +192,7 @@ class ExprInspector::Priv : public sigc::trackable { && (a_variable->members ().size () || a_variable->needs_unfolding ())) tree_view->expand_row (tree_store->get_path (var_row), false); - variable = a_variable; + variable_ = a_variable; } void @@ -207,7 +207,7 @@ class ExprInspector::Priv : public sigc::trackable { re_visualize = a_re_visualize; re_init_tree_view (); - variable = a_variable; + variable_ = a_variable; if (a_re_visualize) { debugger.revisualize_variable (a_variable, sigc::bind @@ -427,17 +427,17 @@ class ExprInspector::Priv : public sigc::trackable { if (!var) return; - variable = var; + variable_ = var; // If the variable should be editable, set the cell of the variable value // editable. cur_selected_row->set_value (vutil::get_variable_columns ().variable_value_editable, - debugger.is_variable_editable (variable)); + debugger.is_variable_editable (variable_)); // Dump some log about the variable that got selected. UString qname; - variable->build_qname (qname); + variable_->build_qname (qname); LOG_DD ("row of variable '" << qname << "'"); NEMIVER_CATCH @@ -742,7 +742,7 @@ ExprInspector::get_expression () const { THROW_IF_FAIL (m_priv); - return m_priv->variable; + return m_priv->variable_; } void diff --git a/src/persp/dbgperspective/nmv-expr-monitor.cc b/src/persp/dbgperspective/nmv-expr-monitor.cc index 651fc4b..179a956 100644 --- a/src/persp/dbgperspective/nmv-expr-monitor.cc +++ b/src/persp/dbgperspective/nmv-expr-monitor.cc @@ -59,7 +59,7 @@ struct ExprMonitor::Priv IDebugger::VariableList killed_expressions; map in_scope_exprs; map revived_exprs; - vector selected_paths; + vector selected_paths_; Glib::RefPtr action_group; Gtk::Widget *contextual_menu; IDebugger::Frame saved_frame; @@ -1223,7 +1223,7 @@ struct ExprMonitor::Priv Glib::RefPtr selection = tree_view->get_selection (); THROW_IF_FAIL (selection); - selected_paths = + selected_paths_ = selection->get_selected_rows (); NEMIVER_CATCH; diff --git a/src/uicommon/nmv-source-editor.cc b/src/uicommon/nmv-source-editor.cc index 3702bcd..da7daa0 100644 --- a/src/uicommon/nmv-source-editor.cc +++ b/src/uicommon/nmv-source-editor.cc @@ -178,7 +178,7 @@ struct SourceEditor::Priv { Gtk::Label *line_col_label; Gtk::Box *status_box; enum SourceEditor::BufferType buffer_type; - UString path; + UString path_; struct NonAssemblyBufContext { Glib::RefPtr buffer; @@ -905,7 +905,7 @@ SourceEditor::move_where_marker_to_line (int a_line, bool a_do_scroll) Glib::RefPtr where_marker = source_view ().get_source_buffer ()->get_mark (WHERE_MARK); if (!where_marker) { - Glib::RefPtr where_marker = + where_marker = source_view ().get_source_buffer ()->create_source_mark (WHERE_MARK, WHERE_CATEGORY, @@ -1028,8 +1028,6 @@ SourceEditor::clear_decorations () typedef std::map >::iterator SourceMarkMapIter; - SourceMarkMapIter it; - std::list marks_to_erase; // Clear breakpoint markers and erase them from the hash map that @@ -1123,19 +1121,19 @@ SourceEditor::scroll_to_iter (Gtk::TextIter &a_iter) void SourceEditor::set_path (const UString &a_path) { - m_priv->path = a_path; + m_priv->path_ = a_path; } void SourceEditor::get_path (UString &a_path) const { - a_path = m_priv->path; + a_path = m_priv->path_; } const UString& SourceEditor::get_path () const { - return m_priv->path; + return m_priv->path_; } void -- 2.9.3