← Back to team overview

kicad-developers team mailing list archive

[PATCH] compile broken on clang - overload conflict

 

5720 broke the build on clang by making SCH_SHEET_LIST::GetSheet(int) a 
const method, which changed the overload resolution order and resulted 
in failure due to ambiguity. This patch ranames 
SCH_SHEET_LIST::GetSheet(const wxString, bool) to ::GetSheetByPath to 
resolve that conflict.

--
Chris
commit e950b692b8985c1c5037999b3f6936f1d1c993d3
Author: Chris Pavlina <cpavlin1@xxxxxxxxxxxxxx>
Date:   Sun Jun 7 21:14:07 2015 -0400

    Resolve clang overload conflict

diff --git a/eeschema/find.cpp b/eeschema/find.cpp
index 74801bf..2d4b55c 100644
--- a/eeschema/find.cpp
+++ b/eeschema/find.cpp
@@ -366,7 +366,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
 
             SetUndoItem( undoItem );
 
-            sheet = schematic.GetSheet( data.GetSheetPath() );
+            sheet = schematic.GetSheetByPath( data.GetSheetPath() );
 
             wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) + data.GetSheetPath() );
 
@@ -396,7 +396,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
 
         SetUndoItem( undoItem );
 
-        sheet = schematic.GetSheet( data.GetSheetPath() );
+        sheet = schematic.GetSheetByPath( data.GetSheetPath() );
 
         wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) + data.GetSheetPath() );
 
@@ -429,7 +429,7 @@ void SCH_EDIT_FRAME::updateFindReplaceView( wxFindDialogEvent& aEvent )
     {
         wxLogTrace( traceFindReplace, wxT( "Found " ) + m_foundItems.GetText() );
 
-        SCH_SHEET_PATH* sheet = schematic.GetSheet( data.GetSheetPath() );
+        SCH_SHEET_PATH* sheet = schematic.GetSheetByPath( data.GetSheetPath() );
 
         wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) +
                      data.GetSheetPath() );
diff --git a/eeschema/sch_sheet_path.cpp b/eeschema/sch_sheet_path.cpp
index 3fa59f3..52027e3 100644
--- a/eeschema/sch_sheet_path.cpp
+++ b/eeschema/sch_sheet_path.cpp
@@ -624,7 +624,7 @@ SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheet( int aIndex ) const
 }
 
 
-SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheet( const wxString aPath, bool aHumanReadable )
+SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheetByPath( const wxString aPath, bool aHumanReadable )
 {
     SCH_SHEET_PATH* sheet = GetFirst();
     wxString sheetPath;
diff --git a/eeschema/sch_sheet_path.h b/eeschema/sch_sheet_path.h
index 0afdc6a..5cd60bc 100644
--- a/eeschema/sch_sheet_path.h
+++ b/eeschema/sch_sheet_path.h
@@ -423,7 +423,7 @@ public:
     SCH_SHEET_PATH* GetSheet( int aIndex ) const;
 
     /**
-     * Function GetSheet
+     * Function GetSheetByPath
      * returns a sheet matching the path name in \a aPath.
      *
      * @param aPath A wxString object containing path of the sheet to get.
@@ -432,7 +432,7 @@ public:
      * @return The sheet that matches \a aPath or NULL if no sheet matching
      *         \a aPath is found.
      */
-    SCH_SHEET_PATH* GetSheet( const wxString aPath, bool aHumanReadable = true );
+    SCH_SHEET_PATH* GetSheetByPath( const wxString aPath, bool aHumanReadable = true );
 
     /**
      * Function IsModified

Follow ups