From 0d27fed9c10ec694244fc54b14862882fb3b2ed9 Mon Sep 17 00:00:00 2001 From: Michael Narigon Date: Wed, 30 Jul 2014 22:04:34 -0500 Subject: [PATCH] warnings --- cvpcb/class_footprints_listbox.cpp | 10 ++++++---- cvpcb/class_library_listbox.cpp | 10 ++++++---- pcb_calculator/datafile_read_write.h | 2 +- pcbnew/modview_frame.cpp | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/cvpcb/class_footprints_listbox.cpp b/cvpcb/class_footprints_listbox.cpp index 2dfbf93bc5..fc486d128c 100644 --- a/cvpcb/class_footprints_listbox.cpp +++ b/cvpcb/class_footprints_listbox.cpp @@ -60,11 +60,13 @@ int FOOTPRINTS_LISTBOX::GetCount() void FOOTPRINTS_LISTBOX::SetString( unsigned linecount, const wxString& text ) { - if( linecount >= m_footprintList.Count() ) - linecount = m_footprintList.Count() - 1; - - if( linecount >= 0 ) + unsigned count = m_footprintList.Count(); + if( count > 0 ) + { + if( linecount >= count ) + linecount = count - 1; m_footprintList[linecount] = text; + } } diff --git a/cvpcb/class_library_listbox.cpp b/cvpcb/class_library_listbox.cpp index e543b81459..ee2ea62717 100644 --- a/cvpcb/class_library_listbox.cpp +++ b/cvpcb/class_library_listbox.cpp @@ -60,11 +60,13 @@ int LIBRARY_LISTBOX::GetCount() void LIBRARY_LISTBOX::SetString( unsigned linecount, const wxString& text ) { - if( linecount >= m_libraryList.Count() ) - linecount = m_libraryList.Count() - 1; - - if( linecount >= 0 ) + unsigned count = m_libraryList.Count(); + if( count > 0 ) + { + if( linecount >= count ) + linecount = count - 1; m_libraryList[linecount] = text; + } } diff --git a/pcb_calculator/datafile_read_write.h b/pcb_calculator/datafile_read_write.h index 0100ef2cc6..1f04bde37b 100644 --- a/pcb_calculator/datafile_read_write.h +++ b/pcb_calculator/datafile_read_write.h @@ -1,5 +1,5 @@ #ifndef DATAFILE_READ_WRITE_H_ -#define PDATAFILE_READ_WRITE_H_ +#define DATAFILE_READ_WRITE_H_ /* * This program source code file is part of KiCad, a free EDA CAD application. * diff --git a/pcbnew/modview_frame.cpp b/pcbnew/modview_frame.cpp index 29c194b75e..68f1bb5853 100644 --- a/pcbnew/modview_frame.cpp +++ b/pcbnew/modview_frame.cpp @@ -713,8 +713,8 @@ void FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList( wxCommandEvent& event ) break; default: - wxFAIL_MSG( wxT( "FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList error: id = " ) + - event.GetId() ); + wxString id = wxString::Format(wxT("%i"),event.GetId()); + wxFAIL_MSG( wxT( "FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList error: id = " ) + id ); } }