Eeschema: fix a colliding name between sch_text.h and a Windows/msys2 header.

"INPUT" declaration in sch_text.h generate *a lot of* compil warnings.
So it is replaced by PS_INPUT.
For consistency, others member of enum class PINSHEETLABEL_SHAPE are also renamed.
This commit is contained in:
jean-pierre charras 2020-01-09 08:52:30 +01:00
parent ca34ade00c
commit c17c9960d8
7 changed files with 51 additions and 50 deletions

View File

@ -98,7 +98,7 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCreateMarkers )
{
auto p = static_cast<SCH_SHEET_PIN*>( c );
if( p->GetShape() == PINSHEETLABEL_SHAPE::OUTPUT )
if( p->GetShape() == PINSHEETLABEL_SHAPE::PSHAPE_OUTPUT )
{
m_driver = c;
break;

View File

@ -39,7 +39,7 @@
#include "invoke_sch_dialog.h"
static PINSHEETLABEL_SHAPE lastGlobalLabelShape = PINSHEETLABEL_SHAPE::INPUT;
static PINSHEETLABEL_SHAPE lastGlobalLabelShape = PINSHEETLABEL_SHAPE::PS_INPUT;
static LABEL_SPIN_STYLE lastTextOrientation = LABEL_SPIN_STYLE::LEFT;
static bool lastTextBold = false;
static bool lastTextItalic = false;

View File

@ -1033,23 +1033,23 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader )
switch( parseChar( aReader, line, &line ) )
{
case 'I':
sheetPin->SetShape( PINSHEETLABEL_SHAPE::INPUT );
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_INPUT );
break;
case 'O':
sheetPin->SetShape( PINSHEETLABEL_SHAPE::OUTPUT );
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_OUTPUT );
break;
case 'B':
sheetPin->SetShape( PINSHEETLABEL_SHAPE::BIDI );
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_BIDI );
break;
case 'T':
sheetPin->SetShape( PINSHEETLABEL_SHAPE::TRISTATE );
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_TRISTATE );
break;
case 'U':
sheetPin->SetShape( PINSHEETLABEL_SHAPE::UNSPECIFIED );
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED );
break;
default:
SCH_PARSE_ERROR( "invalid sheet pin type", aReader, line );
@ -1364,11 +1364,11 @@ SCH_BUS_ENTRY_BASE* SCH_LEGACY_PLUGIN::loadBusEntry( LINE_READER& aReader )
// clang-format off
const std::map<PINSHEETLABEL_SHAPE, const char*> sheetLabelNames
{
{ PINSHEETLABEL_SHAPE::INPUT, "Input" },
{ PINSHEETLABEL_SHAPE::OUTPUT, "Output" },
{ PINSHEETLABEL_SHAPE::BIDI, "BiDi" },
{ PINSHEETLABEL_SHAPE::TRISTATE, "3State" },
{ PINSHEETLABEL_SHAPE::UNSPECIFIED, "UnSpc" },
{ PINSHEETLABEL_SHAPE::PS_INPUT, "Input" },
{ PINSHEETLABEL_SHAPE::PS_OUTPUT, "Output" },
{ PINSHEETLABEL_SHAPE::PS_BIDI, "BiDi" },
{ PINSHEETLABEL_SHAPE::PS_TRISTATE, "3State" },
{ PINSHEETLABEL_SHAPE::PS_UNSPECIFIED, "UnSpc" },
};
// clang-format on
@ -2187,20 +2187,20 @@ void SCH_LEGACY_PLUGIN::saveSheet( SCH_SHEET* aSheet )
switch( pin.GetShape() )
{
case PINSHEETLABEL_SHAPE::INPUT:
case PINSHEETLABEL_SHAPE::PS_INPUT:
type = 'I';
break;
case PINSHEETLABEL_SHAPE::OUTPUT:
case PINSHEETLABEL_SHAPE::PS_OUTPUT:
type = 'O';
break;
case PINSHEETLABEL_SHAPE::BIDI:
case PINSHEETLABEL_SHAPE::PS_BIDI:
type = 'B';
break;
case PINSHEETLABEL_SHAPE::TRISTATE:
case PINSHEETLABEL_SHAPE::PS_TRISTATE:
type = 'T';
break;
default:
case PINSHEETLABEL_SHAPE::UNSPECIFIED:
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED:
type = 'U';
break;
}

View File

@ -50,7 +50,7 @@ SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxStr
else
SetEdge( SHEET_LEFT_SIDE );
m_shape = PINSHEETLABEL_SHAPE::INPUT;
m_shape = PINSHEETLABEL_SHAPE::PS_INPUT;
m_isDangling = true;
m_number = 2;
}
@ -252,11 +252,11 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aPoints, const wx
switch( m_shape )
{
case PINSHEETLABEL_SHAPE::INPUT:
m_shape = PINSHEETLABEL_SHAPE::OUTPUT;
case PINSHEETLABEL_SHAPE::PS_INPUT:
m_shape = PINSHEETLABEL_SHAPE::PS_OUTPUT;
break;
case PINSHEETLABEL_SHAPE::OUTPUT:
m_shape = PINSHEETLABEL_SHAPE::INPUT;
case PINSHEETLABEL_SHAPE::PS_OUTPUT:
m_shape = PINSHEETLABEL_SHAPE::PS_INPUT;
break;
default:
break;

View File

@ -97,7 +97,7 @@ static int* TemplateShape[5][4] =
SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType )
: SCH_ITEM( NULL, aType ), EDA_TEXT( text ), m_shape( PINSHEETLABEL_SHAPE::INPUT )
: SCH_ITEM( NULL, aType ), EDA_TEXT( text ), m_shape( PINSHEETLABEL_SHAPE::PS_INPUT )
{
m_Layer = LAYER_NOTES;
m_isDangling = false;
@ -587,19 +587,19 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
{
switch( GetShape() )
{
case PINSHEETLABEL_SHAPE::INPUT:
case PINSHEETLABEL_SHAPE::PS_INPUT:
msg = _( "Input" );
break;
case PINSHEETLABEL_SHAPE::OUTPUT:
case PINSHEETLABEL_SHAPE::PS_OUTPUT:
msg = _( "Output" );
break;
case PINSHEETLABEL_SHAPE::BIDI:
case PINSHEETLABEL_SHAPE::PS_BIDI:
msg = _( "Bidirectional" );
break;
case PINSHEETLABEL_SHAPE::TRISTATE:
case PINSHEETLABEL_SHAPE::PS_TRISTATE:
msg = _( "Tri-State" );
break;
case PINSHEETLABEL_SHAPE::UNSPECIFIED:
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED:
msg = _( "Passive" );
break;
default:
@ -647,7 +647,7 @@ SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text )
: SCH_TEXT( pos, text, SCH_LABEL_T )
{
m_Layer = LAYER_LOCLABEL;
m_shape = PINSHEETLABEL_SHAPE::INPUT;
m_shape = PINSHEETLABEL_SHAPE::PS_INPUT;
m_isDangling = true;
SetMultilineAllowed( false );
}
@ -731,7 +731,7 @@ SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text )
: SCH_TEXT( pos, text, SCH_GLOBAL_LABEL_T )
{
m_Layer = LAYER_GLOBLABEL;
m_shape = PINSHEETLABEL_SHAPE::BIDI;
m_shape = PINSHEETLABEL_SHAPE::PS_BIDI;
m_isDangling = true;
SetMultilineAllowed( false );
}
@ -754,14 +754,14 @@ wxPoint SCH_GLOBALLABEL::GetSchematicTextOffset() const
switch( m_shape )
{
case PINSHEETLABEL_SHAPE::INPUT:
case PINSHEETLABEL_SHAPE::BIDI:
case PINSHEETLABEL_SHAPE::TRISTATE:
case PINSHEETLABEL_SHAPE::PS_INPUT:
case PINSHEETLABEL_SHAPE::PS_BIDI:
case PINSHEETLABEL_SHAPE::PS_TRISTATE:
offset += halfSize;
break;
case PINSHEETLABEL_SHAPE::OUTPUT:
case PINSHEETLABEL_SHAPE::UNSPECIFIED:
case PINSHEETLABEL_SHAPE::PS_OUTPUT:
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED:
offset += TXT_MARGIN;
break;
@ -895,23 +895,23 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aPoints, const
switch( m_shape )
{
case PINSHEETLABEL_SHAPE::INPUT:
case PINSHEETLABEL_SHAPE::PS_INPUT:
x_offset = -halfSize;
aPoints[0].x += halfSize;
break;
case PINSHEETLABEL_SHAPE::OUTPUT:
case PINSHEETLABEL_SHAPE::PS_OUTPUT:
aPoints[3].x -= halfSize;
break;
case PINSHEETLABEL_SHAPE::BIDI:
case PINSHEETLABEL_SHAPE::TRISTATE:
case PINSHEETLABEL_SHAPE::PS_BIDI:
case PINSHEETLABEL_SHAPE::PS_TRISTATE:
x_offset = -halfSize;
aPoints[0].x += halfSize;
aPoints[3].x -= halfSize;
break;
case PINSHEETLABEL_SHAPE::UNSPECIFIED:
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED:
default:
break;
}
@ -1019,7 +1019,7 @@ SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text, KICAD_T
: SCH_TEXT( pos, text, aType )
{
m_Layer = LAYER_HIERLABEL;
m_shape = PINSHEETLABEL_SHAPE::INPUT;
m_shape = PINSHEETLABEL_SHAPE::PS_INPUT;
m_isDangling = true;
SetMultilineAllowed( false );
}

View File

@ -196,11 +196,12 @@ private:
*/
enum class PINSHEETLABEL_SHAPE
{
INPUT,
OUTPUT,
BIDI,
TRISTATE,
UNSPECIFIED
PS_INPUT, // use "PS_INPUT" instead of "INPUT" to avoid colliding
// with a Windows header on msys2
PS_OUTPUT,
PS_BIDI,
PS_TRISTATE,
PS_UNSPECIFIED
};

View File

@ -766,7 +766,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
}
PINSHEETLABEL_SHAPE SCH_EDIT_FRAME::m_lastSheetPinType = PINSHEETLABEL_SHAPE::INPUT;
PINSHEETLABEL_SHAPE SCH_EDIT_FRAME::m_lastSheetPinType = PINSHEETLABEL_SHAPE::PS_INPUT;
wxSize SCH_EDIT_FRAME::m_lastSheetPinTextSize( -1, -1 );
wxPoint SCH_EDIT_FRAME::m_lastSheetPinPosition;