diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 96ad5cc6f3..f3190a2f63 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -885,7 +885,7 @@ bool LIB_PART::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) { p = strtok( line, " \t\n" ); - if( p && stricmp( p, "ENDDEF" ) == 0 ) + if( p && strcasecmp( p, "ENDDEF" ) == 0 ) break; } @@ -1143,7 +1143,7 @@ bool LIB_PART::LoadFootprints( LINE_READER& aLineReader, wxString& aErrorMsg ) p = strtok( line, " \t\r\n" ); - if( stricmp( p, "$ENDFPLIST" ) == 0 ) + if( strcasecmp( p, "$ENDFPLIST" ) == 0 ) break; m_FootprintList.Add( FROM_UTF8( p ) ); diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 7af694295d..197c2a6f41 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -458,7 +458,7 @@ bool PART_LIB::Load( wxString& aErrorMsg ) { 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 ) ) { @@ -471,7 +471,7 @@ bool PART_LIB::Load( wxString& aErrorMsg ) wxString msg; - if( strnicmp( line, "DEF", 3 ) == 0 ) + if( strncasecmp( line, "DEF", 3 ) == 0 ) { // Read one DEF/ENDDEF part entry from library: 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" ); data = strtok( NULL, " \t\r\n" ); - if( stricmp( text, "TimeStamp" ) == 0 ) + if( strcasecmp( text, "TimeStamp" ) == 0 ) timeStamp = atol( data ); - if( stricmp( text, "$ENDHEADER" ) == 0 ) + if( strcasecmp( text, "$ENDHEADER" ) == 0 ) return true; } @@ -574,7 +574,7 @@ bool PART_LIB::LoadDocs( wxString& aErrorMsg ) 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." ), GetChars( fn.GetFullPath() ) ); diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index be8ad78402..28f3f442c0 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -142,7 +142,7 @@ bool LIB_TEXT::Load( LINE_READER& aLineReader, wxString& errorMsg ) m_Size.y = m_Size.x; - if( strnicmp( tmp, "Italic", 6 ) == 0 ) + if( strncasecmp( tmp, "Italic", 6 ) == 0 ) m_Italic = true; if( thickness > 0 ) diff --git a/eeschema/load_one_schematic_file.cpp b/eeschema/load_one_schematic_file.cpp index 5d4e3458a9..bb4dc81ff2 100644 --- a/eeschema/load_one_schematic_file.cpp +++ b/eeschema/load_one_schematic_file.cpp @@ -160,7 +160,7 @@ again." ); while( *line == ' ' ) line++; - if( strnicmp( line, "EELAYER END", 11 ) == 0 ) + if( strncasecmp( line, "EELAYER END", 11 ) == 0 ) break; // end of not used header found } @@ -342,66 +342,66 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, SCH_SCREEN* aScree line = aLine->Line(); - if( strnicmp( line, "$End", 4 ) == 0 ) + if( strncasecmp( line, "$End", 4 ) == 0 ) { aScreen->SetTitleBlock( tb ); break; } - if( strnicmp( line, "Sheet", 2 ) == 0 ) + if( strncasecmp( line, "Sheet", 2 ) == 0 ) sscanf( line + 5, " %d %d", &aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreens ); - if( strnicmp( line, "Title", 2 ) == 0 ) + if( strncasecmp( line, "Title", 2 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetTitle( FROM_UTF8( buf ) ); continue; } - if( strnicmp( line, "Date", 2 ) == 0 ) + if( strncasecmp( line, "Date", 2 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetDate( FROM_UTF8( buf ) ); continue; } - if( strnicmp( line, "Rev", 2 ) == 0 ) + if( strncasecmp( line, "Rev", 2 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetRevision( FROM_UTF8( buf ) ); continue; } - if( strnicmp( line, "Comp", 4 ) == 0 ) + if( strncasecmp( line, "Comp", 4 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetCompany( FROM_UTF8( buf ) ); continue; } - if( strnicmp( line, "Comment1", 8 ) == 0 ) + if( strncasecmp( line, "Comment1", 8 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetComment1( FROM_UTF8( buf ) ); continue; } - if( strnicmp( line, "Comment2", 8 ) == 0 ) + if( strncasecmp( line, "Comment2", 8 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetComment2( FROM_UTF8( buf ) ); continue; } - if( strnicmp( line, "Comment3", 8 ) == 0 ) + if( strncasecmp( line, "Comment3", 8 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetComment3( FROM_UTF8( buf ) ); continue; } - if( strnicmp( line, "Comment4", 8 ) == 0 ) + if( strncasecmp( line, "Comment4", 8 ) == 0 ) { ReadDelimitedText( buf, line, 256 ); tb.SetComment4( FROM_UTF8( buf ) ); diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index f02be0a57e..44e0a52c01 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -136,7 +136,7 @@ bool SCH_BITMAP::Load( LINE_READER& aLine, wxString& aErrorMsg ) { 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" ), aLine.LineNumber() ); @@ -151,13 +151,13 @@ bool SCH_BITMAP::Load( LINE_READER& aLine, wxString& aErrorMsg ) 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 ); continue; } - if( strnicmp( line, "Scale", 5 ) == 0 ) + if( strncasecmp( line, "Scale", 5 ) == 0 ) { double scale = 1.0; sscanf( line + 5, "%lf", &scale ); @@ -165,12 +165,12 @@ bool SCH_BITMAP::Load( LINE_READER& aLine, wxString& aErrorMsg ) continue; } - if( strnicmp( line, "Data", 4 ) == 0 ) + if( strncasecmp( line, "Data", 4 ) == 0 ) { m_image->LoadData( aLine, aErrorMsg ); } - if( strnicmp( line, "$EndBitmap", 4 ) == 0 ) + if( strncasecmp( line, "$EndBitmap", 4 ) == 0 ) break; } diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 097a4991ab..f1f3840419 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1450,7 +1450,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg ) if( !(line = aLine.ReadLine()) ) return false; - if( strnicmp( "$End", line, 4 ) != 0 ) + if( strncasecmp( "$End", line, 4 ) != 0 ) { aErrorMsg.Printf( wxT( "Component End expected at line %d, aborted" ), aLine.LineNumber() ); diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index e437ce4816..5b74045917 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -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" ), aLine.LineNumber() ); diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 65c9726f3e..ec2bfd6d9b 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -484,7 +484,7 @@ bool SCH_TEXT::Load( LINE_READER& aLine, wxString& aErrorMsg ) m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0; } - if( strnicmp( Name2, "Italic", 6 ) == 0 ) + if( strncasecmp( Name2, "Italic", 6 ) == 0 ) m_Italic = 1; return true; @@ -947,7 +947,7 @@ bool SCH_LABEL::Load( LINE_READER& aLine, wxString& aErrorMsg ) m_Thickness = m_Bold ? GetPenSizeForBold( size ) : 0; } - if( stricmp( Name2, "Italic" ) == 0 ) + if( strcasecmp( Name2, "Italic" ) == 0 ) m_Italic = 1; return true; @@ -1077,19 +1077,19 @@ bool SCH_GLOBALLABEL::Load( LINE_READER& aLine, wxString& aErrorMsg ) m_Bold = ( thickness != 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; - if( stricmp( Name2, SheetLabelType[NET_BIDI] ) == 0 ) + if( strcasecmp( Name2, SheetLabelType[NET_BIDI] ) == 0 ) m_shape = NET_BIDI; - if( stricmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 ) + if( strcasecmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 ) m_shape = NET_TRISTATE; - if( stricmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 ) + if( strcasecmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 ) m_shape = NET_UNSPECIFIED; - if( stricmp( Name3, "Italic" ) == 0 ) + if( strcasecmp( Name3, "Italic" ) == 0 ) m_Italic = 1; return true; @@ -1521,19 +1521,19 @@ bool SCH_HIERLABEL::Load( LINE_READER& aLine, wxString& aErrorMsg ) m_Bold = ( thickness != 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; - if( stricmp( Name2, SheetLabelType[NET_BIDI] ) == 0 ) + if( strcasecmp( Name2, SheetLabelType[NET_BIDI] ) == 0 ) m_shape = NET_BIDI; - if( stricmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 ) + if( strcasecmp( Name2, SheetLabelType[NET_TRISTATE] ) == 0 ) m_shape = NET_TRISTATE; - if( stricmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 ) + if( strcasecmp( Name2, SheetLabelType[NET_UNSPECIFIED] ) == 0 ) m_shape = NET_UNSPECIFIED; - if( stricmp( Name3, "Italic" ) == 0 ) + if( strcasecmp( Name3, "Italic" ) == 0 ) m_Italic = 1; return true;