Skip to content

Commit ea1c3e5

Browse files
committed
refactor(clang-tidy): fix remaining bugprone-suspicious-string-compare instances
1 parent 526aef9 commit ea1c3e5

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Core/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void Create_Hash_Name(StringClass& name, const StringClass& thumb_name)
3737
{
3838
name=thumb_name;
3939
int len=name.Get_Length();
40-
WWASSERT(!stricmp(&name[len-4],".tga") || !stricmp(&name[len-4],".dds"));
40+
WWASSERT(stricmp(&name[len-4],".tga") == 0 || stricmp(&name[len-4],".dds") == 0);
4141
name[len-4]='\0';
4242
_strlwr(name.Peek_Buffer());
4343
}

Core/Tools/Autorun/GameText.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ Bool GameTextManager::getStringCount( char *filename )
778778
m_buffer[ len+1] = 0;
779779
readToEndOfQuote( &file, &m_buffer[1], m_buffer2, m_buffer3, MAX_UITEXT_LENGTH );
780780
}
781-
else if( !stricmp( m_buffer, "END") )
781+
else if( stricmp( m_buffer, "END") == 0 )
782782
{
783783
m_textCount++;
784784
}
@@ -974,7 +974,7 @@ Bool GameTextManager::parseStringFile( char *filename )
974974

975975
for ( Int i = 0; i < listCount; i++ )
976976
{
977-
if ( !stricmp ( m_stringInfo[i].label.c_str(), m_buffer ))
977+
if ( stricmp ( m_stringInfo[i].label.c_str(), m_buffer ) == 0 )
978978
{
979979
DEBUG_ASSERTCRASH ( FALSE, ("String label '%s' multiply defined!", m_buffer ));
980980
}
@@ -1025,7 +1025,7 @@ Bool GameTextManager::parseStringFile( char *filename )
10251025
readString = TRUE;
10261026
}
10271027
}
1028-
else if ( !stricmp ( m_buffer, "END" ))
1028+
else if ( stricmp ( m_buffer, "END" ) == 0 )
10291029
{
10301030
break;
10311031
}

Core/Tools/Compress/Compress.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ int main(int argc, char **argv)
5858

5959
for (int i=1; i<argc; ++i)
6060
{
61-
if ( !stricmp(argv[i], "-help") )
61+
if ( stricmp(argv[i], "-help") == 0 )
6262
{
6363
dumpHelp(argv[0]);
6464
return EXIT_SUCCESS;
6565
}
6666

67-
if ( !strcmp(argv[i], "-in") )
67+
if ( strcmp(argv[i], "-in") == 0 )
6868
{
6969
++i;
7070
if (i<argc)
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
7373
}
7474
}
7575

76-
if ( !strcmp(argv[i], "-out") )
76+
if ( strcmp(argv[i], "-out") == 0 )
7777
{
7878
++i;
7979
if (i<argc)
@@ -82,14 +82,14 @@ int main(int argc, char **argv)
8282
}
8383
}
8484

85-
if ( !strcmp(argv[i], "-type") )
85+
if ( strcmp(argv[i], "-type") == 0 )
8686
{
8787
++i;
8888
if (i<argc)
8989
{
9090
for (int j=COMPRESSION_MIN; j<=COMPRESSION_MAX; ++j)
9191
{
92-
if ( !stricmp(CompressionManager::getCompressionNameByType((CompressionType)j), argv[i]) )
92+
if ( stricmp(CompressionManager::getCompressionNameByType((CompressionType)j), argv[i]) == 0 )
9393
{
9494
compressType = (CompressionType)j;
9595
break;

Core/Tools/W3DView/W3DView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void Debug_Refs(void)
344344
ActiveRefStruct * search_ref = &(search_obj->ActiveRefInfo);
345345

346346
if ( ref->File && search_ref->File &&
347-
!strcmp(search_ref->File, ref->File) &&
347+
strcmp(search_ref->File, ref->File) == 0 &&
348348
(search_ref->Line == ref->Line) ) {
349349
count++;
350350
} else if ( (ref->File == NULL) && (search_ref->File == NULL) ) {

0 commit comments

Comments
 (0)