Remove unneeded compile option KICAD_KEEPCASE

Libraries have been 100% case-sensitive for a while now; there is no longer a
need to keep this option around. This will change nothing except for any
stragglers still manually specifying this old option.
This commit is contained in:
Chris Pavlina 2016-06-10 23:15:02 -04:00
parent 588d4c33a0
commit c13f80bb49
10 changed files with 18 additions and 68 deletions

View File

@ -23,19 +23,6 @@ set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
# reports.
#
# The desire is to migrate designs *away from* case independence, and to create designs which use
# literally (case specific) interpreted component names. But for backwards compatibility,
# you may turn OFF this option if you really must. (Remember that with KiCad using text
# data files, typically you would be better off simply doctoring those files into
# a case literal state with a text editor and move forward into the brave new
# world of case specificity. Also, BOM generators may not work properly when you
# have this option turned OFF, the xml export's referential integrity is broken
# on library part name. Hence the default is ON now, as of 29-Jan-2014.
option( KICAD_KEEPCASE
"Use case sensitive string matching for component names (default ON)."
ON
)
option( USE_WX_GRAPHICS_CONTEXT
"Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental" )
@ -243,10 +230,6 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if( KICAD_KEEPCASE )
add_definitions( -DKICAD_KEEPCASE )
endif()
if( USE_WX_OVERLAY OR APPLE )
add_definitions( -DUSE_WX_OVERLAY )
endif()

View File

@ -123,11 +123,6 @@ KiCad has many build options that can be configured to build different options d
the availability of support for each option on a given platform. This section documents
these options and their default values.
## Case Sensitivity ## {#case_sensitive_opt}
The KICAD_KEEPCASE option allows you to build KiCad so that the string matching for component
names is case sensitive of case insensitive. This option is enabled by default.
## Advanced Graphics Context ## {#graphics_context_opt}
The USE_WX_GRAPHICS_CONTEXT option replaces wxDC with wxGraphicsContext for graphics rendering.

View File

@ -161,10 +161,6 @@ Required for Windows platform.
-DwxWidgets_USE_DEBUG=ON
Can be used only with -DCMAKE_BUILD_TYPE=Debug
-DKICAD_KEEPCASE=ON
Build the KiCad with no component name conversion to uppercase (if you want your
ADuC.../Si.../bq... components named as just so).
-DCMAKE_CXX_FLAGS=<some extra flags>
Extra flags for the c++ compiler for your system required.

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2016 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -95,7 +95,7 @@ void SCH_EDIT_FRAME::backAnnotateFootprints( const std::string& aChangedSetOfRef
// Search the component in the flat list
for( unsigned ii = 0; ii < refs.GetCount(); ++ii )
{
if( Cmp_KEEPCASE( reference, refs[ii].GetRef() ) == 0 )
if( reference == refs[ii].GetRef() )
{
// We have found a candidate.
// Note: it can be not unique (multiple parts per package)
@ -196,7 +196,7 @@ bool SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile( const wxString& aFullFilenam
// Search the component in the flat list
for( unsigned ii = 0; ii < referencesList.GetCount(); ii++ )
{
if( Cmp_KEEPCASE( reference, referencesList[ii].GetRef() ) == 0 )
if( reference == referencesList[ii].GetRef() )
{
// We have found a candidate.
// Note: it can be not unique (multiple units per part)

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -111,7 +111,7 @@ const wxString LIB_ALIAS::GetLibraryName()
bool LIB_ALIAS::IsRoot() const
{
return Cmp_KEEPCASE( name, shared->GetName() ) == 0;
return name == shared->GetName();
}
@ -152,19 +152,19 @@ bool LIB_ALIAS::SaveDoc( OUTPUTFORMATTER& aFormatter )
bool LIB_ALIAS::operator==( const wxChar* aName ) const
{
return Cmp_KEEPCASE( name, aName ) == 0;
return name == aName;
}
bool operator<( const LIB_ALIAS& aItem1, const LIB_ALIAS& aItem2 )
{
return Cmp_KEEPCASE( aItem1.GetName(), aItem2.GetName() ) < 0;
return aItem1.GetName() < aItem2.GetName();
}
int LibraryEntryCompare( const LIB_ALIAS* aItem1, const LIB_ALIAS* aItem2 )
{
return Cmp_KEEPCASE( aItem1->GetName(), aItem2->GetName() );
return aItem1->GetName().Cmp( aItem2->GetName() );
}
@ -1734,7 +1734,7 @@ bool LIB_PART::HasAlias( const wxString& aName ) const
for( size_t i = 0; i < m_aliases.size(); i++ )
{
if( Cmp_KEEPCASE( aName, m_aliases[i]->GetName() ) == 0 )
if( aName == m_aliases[i]->GetName() )
return true;
}
@ -1786,7 +1786,7 @@ void LIB_PART::RemoveAlias( const wxString& aName )
for( it = m_aliases.begin(); it != m_aliases.end(); it++ )
{
if( Cmp_KEEPCASE( aName, (*it)->GetName() ) == 0 )
if( aName == (*it)->GetName() )
{
m_aliases.erase( it );
break;
@ -1858,7 +1858,7 @@ LIB_ALIAS* LIB_PART::GetAlias( const wxString& aName )
for( size_t i = 0; i < m_aliases.size(); i++ )
{
if( Cmp_KEEPCASE( aName, m_aliases[i]->GetName() ) == 0 )
if( aName == m_aliases[i]->GetName() )
return m_aliases[i];
}

View File

@ -45,19 +45,6 @@ class LIB_PART;
class LIB_FIELD;
/// Compiler controlled string compare function, either case independent or not:
inline int Cmp_KEEPCASE( const wxString& aString1, const wxString& aString2 )
{
#ifdef KICAD_KEEPCASE
// case specificity, the normal behavior:
return aString1.Cmp( aString2 );
#else
// case independence (only for guys who want that: not recommended)
return aString1.CmpNoCase( aString2 );
#endif
}
typedef std::vector<LIB_ALIAS*> LIB_ALIASES;
typedef boost::shared_ptr<LIB_PART> PART_SPTR; ///< shared pointer to LIB_PART
typedef boost::weak_ptr<LIB_PART> PART_REF; ///< weak pointer to LIB_PART

View File

@ -171,7 +171,7 @@ struct AliasMapSort
{
bool operator() ( const wxString& aItem1, const wxString& aItem2 ) const
{
return Cmp_KEEPCASE( aItem1, aItem2 ) < 0;
return aItem1 < aItem2;
}
};

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -319,7 +319,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
{
DisplayError( NULL, _( "No Component Name!" ) );
}
else if( Cmp_KEEPCASE( newname, m_cmp->m_part_name ) )
else if( newname != m_cmp->m_part_name )
{
PART_LIBS* libs = Prj().SchLibs();

View File

@ -50,17 +50,6 @@
#define IS_WIRE false
#define IS_BUS true
/** @brief Kicad can use case sensitive or case insensitive comparisons for labels
* Currently, it uses case insensitive.
* Can be changed by comment/uncomment next lines.
*/
inline int CmpLabel_KEEPCASE( const wxString& aString1, const wxString& aString2 )
{
return aString1.Cmp( aString2 ); // case sensitive
//return aString1.CmpNoCase( aString2 ); // case insensitive
}
//Imported function:
int TestDuplicateSheetNames( bool aCreateMarker );
@ -630,7 +619,7 @@ void NETLIST_OBJECT_LIST::sheetLabelConnect( NETLIST_OBJECT* SheetLabel )
if( ObjetNet->GetNet() == SheetLabel->GetNet() )
continue; //already connected.
if( CmpLabel_KEEPCASE( ObjetNet->m_Label, SheetLabel->m_Label ) != 0 )
if( ObjetNet->m_Label != SheetLabel->m_Label )
continue; //different names.
// Propagate Netcode having all the objects of the same Netcode.
@ -883,7 +872,7 @@ void NETLIST_OBJECT_LIST::labelConnect( NETLIST_OBJECT* aLabelRef )
// NET_PINLABEL is a kind of global label (generated by a power pin invisible)
if( item->IsLabelType() )
{
if( CmpLabel_KEEPCASE( item->m_Label, aLabelRef->m_Label ) != 0 )
if( item->m_Label != aLabelRef->m_Label )
continue;
if( item->GetNet() )

View File

@ -142,7 +142,7 @@ public:
int CompareValue( const SCH_REFERENCE& item ) const
{
return Cmp_KEEPCASE( m_Value->GetText(), item.m_Value->GetText() );
return m_Value->GetText().Cmp( item.m_Value->GetText() );
}
int CompareRef( const SCH_REFERENCE& item ) const
@ -152,7 +152,7 @@ public:
int CompareLibName( const SCH_REFERENCE& item ) const
{
return Cmp_KEEPCASE( m_RootCmp->GetPartName(), item.m_RootCmp->GetPartName() );
return m_RootCmp->GetPartName().Cmp( item.m_RootCmp->GetPartName() );
}
/**