str[n]icmp -> str[n]casecmp
This commit is contained in:
parent
b4d9e7ee99
commit
9748b65a6d
|
@ -885,7 +885,7 @@ bool LIB_PART::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||||
{
|
{
|
||||||
p = strtok( line, " \t\n" );
|
p = strtok( line, " \t\n" );
|
||||||
|
|
||||||
if( p && stricmp( p, "ENDDEF" ) == 0 )
|
if( p && strcasecmp( p, "ENDDEF" ) == 0 )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1143,7 +1143,7 @@ bool LIB_PART::LoadFootprints( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||||
|
|
||||||
p = strtok( line, " \t\r\n" );
|
p = strtok( line, " \t\r\n" );
|
||||||
|
|
||||||
if( stricmp( p, "$ENDFPLIST" ) == 0 )
|
if( strcasecmp( p, "$ENDFPLIST" ) == 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
m_FootprintList.Add( FROM_UTF8( p ) );
|
m_FootprintList.Add( FROM_UTF8( p ) );
|
||||||
|
|
|
@ -458,7 +458,7 @@ bool PART_LIB::Load( wxString& aErrorMsg )
|
||||||
{
|
{
|
||||||
char * line = reader.Line();
|
char * line = reader.Line();
|
||||||
|
|
||||||
if( type == LIBRARY_TYPE_EESCHEMA && strnicmp( line, "$HEADER", 7 ) == 0 )
|
if( type == LIBRARY_TYPE_EESCHEMA && strncasecmp( line, "$HEADER", 7 ) == 0 )
|
||||||
{
|
{
|
||||||
if( !LoadHeader( reader ) )
|
if( !LoadHeader( reader ) )
|
||||||
{
|
{
|
||||||
|
@ -471,7 +471,7 @@ bool PART_LIB::Load( wxString& aErrorMsg )
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
if( strnicmp( line, "DEF", 3 ) == 0 )
|
if( strncasecmp( line, "DEF", 3 ) == 0 )
|
||||||
{
|
{
|
||||||
// Read one DEF/ENDDEF part entry from library:
|
// Read one DEF/ENDDEF part entry from library:
|
||||||
LIB_PART* part = new LIB_PART( wxEmptyString, this );
|
LIB_PART* part = new LIB_PART( wxEmptyString, this );
|
||||||
|
@ -536,10 +536,10 @@ bool PART_LIB::LoadHeader( LINE_READER& aLineReader )
|
||||||
text = strtok( line, " \t\r\n" );
|
text = strtok( line, " \t\r\n" );
|
||||||
data = strtok( NULL, " \t\r\n" );
|
data = strtok( NULL, " \t\r\n" );
|
||||||
|
|
||||||
if( stricmp( text, "TimeStamp" ) == 0 )
|
if( strcasecmp( text, "TimeStamp" ) == 0 )
|
||||||
timeStamp = atol( data );
|
timeStamp = atol( data );
|
||||||
|
|
||||||
if( stricmp( text, "$ENDHEADER" ) == 0 )
|
if( strcasecmp( text, "$ENDHEADER" ) == 0 )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -574,7 +574,7 @@ bool PART_LIB::LoadDocs( wxString& aErrorMsg )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, DOCFILE_IDENT, 10 ) != 0 )
|
if( strncasecmp( line, DOCFILE_IDENT, 10 ) != 0 )
|
||||||
{
|
{
|
||||||
aErrorMsg.Printf( _( "File '%s' is not a valid component library document file." ),
|
aErrorMsg.Printf( _( "File '%s' is not a valid component library document file." ),
|
||||||
GetChars( fn.GetFullPath() ) );
|
GetChars( fn.GetFullPath() ) );
|
||||||
|
|
|
@ -142,7 +142,7 @@ bool LIB_TEXT::Load( LINE_READER& aLineReader, wxString& errorMsg )
|
||||||
|
|
||||||
m_Size.y = m_Size.x;
|
m_Size.y = m_Size.x;
|
||||||
|
|
||||||
if( strnicmp( tmp, "Italic", 6 ) == 0 )
|
if( strncasecmp( tmp, "Italic", 6 ) == 0 )
|
||||||
m_Italic = true;
|
m_Italic = true;
|
||||||
|
|
||||||
if( thickness > 0 )
|
if( thickness > 0 )
|
||||||
|
|
|
@ -160,7 +160,7 @@ again." );
|
||||||
while( *line == ' ' )
|
while( *line == ' ' )
|
||||||
line++;
|
line++;
|
||||||
|
|
||||||
if( strnicmp( line, "EELAYER END", 11 ) == 0 )
|
if( strncasecmp( line, "EELAYER END", 11 ) == 0 )
|
||||||
break; // end of not used header found
|
break; // end of not used header found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,66 +342,66 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, SCH_SCREEN* aScree
|
||||||
|
|
||||||
line = aLine->Line();
|
line = aLine->Line();
|
||||||
|
|
||||||
if( strnicmp( line, "$End", 4 ) == 0 )
|
if( strncasecmp( line, "$End", 4 ) == 0 )
|
||||||
{
|
{
|
||||||
aScreen->SetTitleBlock( tb );
|
aScreen->SetTitleBlock( tb );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Sheet", 2 ) == 0 )
|
if( strncasecmp( line, "Sheet", 2 ) == 0 )
|
||||||
sscanf( line + 5, " %d %d",
|
sscanf( line + 5, " %d %d",
|
||||||
&aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreens );
|
&aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreens );
|
||||||
|
|
||||||
if( strnicmp( line, "Title", 2 ) == 0 )
|
if( strncasecmp( line, "Title", 2 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetTitle( FROM_UTF8( buf ) );
|
tb.SetTitle( FROM_UTF8( buf ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Date", 2 ) == 0 )
|
if( strncasecmp( line, "Date", 2 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetDate( FROM_UTF8( buf ) );
|
tb.SetDate( FROM_UTF8( buf ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Rev", 2 ) == 0 )
|
if( strncasecmp( line, "Rev", 2 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetRevision( FROM_UTF8( buf ) );
|
tb.SetRevision( FROM_UTF8( buf ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Comp", 4 ) == 0 )
|
if( strncasecmp( line, "Comp", 4 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetCompany( FROM_UTF8( buf ) );
|
tb.SetCompany( FROM_UTF8( buf ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Comment1", 8 ) == 0 )
|
if( strncasecmp( line, "Comment1", 8 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetComment1( FROM_UTF8( buf ) );
|
tb.SetComment1( FROM_UTF8( buf ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Comment2", 8 ) == 0 )
|
if( strncasecmp( line, "Comment2", 8 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetComment2( FROM_UTF8( buf ) );
|
tb.SetComment2( FROM_UTF8( buf ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Comment3", 8 ) == 0 )
|
if( strncasecmp( line, "Comment3", 8 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetComment3( FROM_UTF8( buf ) );
|
tb.SetComment3( FROM_UTF8( buf ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Comment4", 8 ) == 0 )
|
if( strncasecmp( line, "Comment4", 8 ) == 0 )
|
||||||
{
|
{
|
||||||
ReadDelimitedText( buf, line, 256 );
|
ReadDelimitedText( buf, line, 256 );
|
||||||
tb.SetComment4( FROM_UTF8( buf ) );
|
tb.SetComment4( FROM_UTF8( buf ) );
|
||||||
|
|
|
@ -136,7 +136,7 @@ bool SCH_BITMAP::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
{
|
{
|
||||||
char* line = aLine.Line();
|
char* line = aLine.Line();
|
||||||
|
|
||||||
if( strnicmp( line, "$Bitmap", 7 ) != 0 )
|
if( strncasecmp( line, "$Bitmap", 7 ) != 0 )
|
||||||
{
|
{
|
||||||
aErrorMsg.Printf( wxT( "Eeschema file bitmap image load error at line %d, aborted" ),
|
aErrorMsg.Printf( wxT( "Eeschema file bitmap image load error at line %d, aborted" ),
|
||||||
aLine.LineNumber() );
|
aLine.LineNumber() );
|
||||||
|
@ -151,13 +151,13 @@ bool SCH_BITMAP::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
|
|
||||||
line = aLine.Line();
|
line = aLine.Line();
|
||||||
|
|
||||||
if( strnicmp( line, "Pos", 3 ) == 0 )
|
if( strncasecmp( line, "Pos", 3 ) == 0 )
|
||||||
{
|
{
|
||||||
sscanf( line + 3, "%d %d", &m_pos.x, &m_pos.y );
|
sscanf( line + 3, "%d %d", &m_pos.x, &m_pos.y );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Scale", 5 ) == 0 )
|
if( strncasecmp( line, "Scale", 5 ) == 0 )
|
||||||
{
|
{
|
||||||
double scale = 1.0;
|
double scale = 1.0;
|
||||||
sscanf( line + 5, "%lf", &scale );
|
sscanf( line + 5, "%lf", &scale );
|
||||||
|
@ -165,12 +165,12 @@ bool SCH_BITMAP::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "Data", 4 ) == 0 )
|
if( strncasecmp( line, "Data", 4 ) == 0 )
|
||||||
{
|
{
|
||||||
m_image->LoadData( aLine, aErrorMsg );
|
m_image->LoadData( aLine, aErrorMsg );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( line, "$EndBitmap", 4 ) == 0 )
|
if( strncasecmp( line, "$EndBitmap", 4 ) == 0 )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1450,7 +1450,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
if( !(line = aLine.ReadLine()) )
|
if( !(line = aLine.ReadLine()) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( strnicmp( "$End", line, 4 ) != 0 )
|
if( strncasecmp( "$End", line, 4 ) != 0 )
|
||||||
{
|
{
|
||||||
aErrorMsg.Printf( wxT( "Component End expected at line %d, aborted" ),
|
aErrorMsg.Printf( wxT( "Component End expected at line %d, aborted" ),
|
||||||
aLine.LineNumber() );
|
aLine.LineNumber() );
|
||||||
|
|
|
@ -316,7 +316,7 @@ bool SCH_SHEET::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( "$End", ((char*)aLine), 4 ) != 0 )
|
if( strncasecmp( "$End", ((char*)aLine), 4 ) != 0 )
|
||||||
{
|
{
|
||||||
aErrorMsg.Printf( wxT( "**Eeschema file end_sheet struct error at line %d, aborted\n" ),
|
aErrorMsg.Printf( wxT( "**Eeschema file end_sheet struct error at line %d, aborted\n" ),
|
||||||
aLine.LineNumber() );
|
aLine.LineNumber() );
|
||||||
|
|
|
@ -484,7 +484,7 @@ bool SCH_TEXT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strnicmp( Name2, "Italic", 6 ) == 0 )
|
if( strncasecmp( Name2, "Italic", 6 ) == 0 )
|
||||||
m_Italic = 1;
|
m_Italic = 1;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -947,7 +947,7 @@ bool SCH_LABEL::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( stricmp( Name2, "Italic" ) == 0 )
|
if( strcasecmp( Name2, "Italic" ) == 0 )
|
||||||
m_Italic = 1;
|
m_Italic = 1;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1077,19 +1077,19 @@ bool SCH_GLOBALLABEL::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
m_Bold = ( thickness != 0 );
|
m_Bold = ( thickness != 0 );
|
||||||
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
|
||||||
m_shape = NET_OUTPUT;
|
m_shape = NET_OUTPUT;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_BIDI] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_BIDI] ) == 0 )
|
||||||
m_shape = NET_BIDI;
|
m_shape = NET_BIDI;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 )
|
||||||
m_shape = NET_TRISTATE;
|
m_shape = NET_TRISTATE;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 )
|
||||||
m_shape = NET_UNSPECIFIED;
|
m_shape = NET_UNSPECIFIED;
|
||||||
|
|
||||||
if( stricmp( Name3, "Italic" ) == 0 )
|
if( strcasecmp( Name3, "Italic" ) == 0 )
|
||||||
m_Italic = 1;
|
m_Italic = 1;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1521,19 +1521,19 @@ bool SCH_HIERLABEL::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
||||||
m_Bold = ( thickness != 0 );
|
m_Bold = ( thickness != 0 );
|
||||||
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
|
||||||
m_shape = NET_OUTPUT;
|
m_shape = NET_OUTPUT;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_BIDI] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_BIDI] ) == 0 )
|
||||||
m_shape = NET_BIDI;
|
m_shape = NET_BIDI;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 )
|
||||||
m_shape = NET_TRISTATE;
|
m_shape = NET_TRISTATE;
|
||||||
|
|
||||||
if( stricmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 )
|
if( strcasecmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 )
|
||||||
m_shape = NET_UNSPECIFIED;
|
m_shape = NET_UNSPECIFIED;
|
||||||
|
|
||||||
if( stricmp( Name3, "Italic" ) == 0 )
|
if( strcasecmp( Name3, "Italic" ) == 0 )
|
||||||
m_Italic = 1;
|
m_Italic = 1;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue