From eb343d3f8f03993e50aa9d1c69d67905944ccd2f Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sat, 1 May 2021 11:13:53 -0400 Subject: [PATCH] Avoid using the string type name as a variable name --- common/string.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/common/string.cpp b/common/string.cpp index d61f60310b..bdb6d39c91 100644 --- a/common/string.cpp +++ b/common/string.cpp @@ -520,13 +520,13 @@ bool WildCompareString( const wxString& pattern, const wxString& string_to_tst, bool case_sensitive ) { const wxChar* cp = NULL, * mp = NULL; - const wxChar* wild, * string; + const wxChar* wild, * str; wxString _pattern, _string_to_tst; if( case_sensitive ) { - wild = pattern.GetData(); - string = string_to_tst.GetData(); + wild = pattern.GetData(); + str = string_to_tst.GetData(); } else { @@ -535,35 +535,36 @@ bool WildCompareString( const wxString& pattern, const wxString& string_to_tst, _string_to_tst = string_to_tst; _string_to_tst.MakeUpper(); wild = _pattern.GetData(); - string = _string_to_tst.GetData(); + str = _string_to_tst.GetData(); } - while( ( *string ) && ( *wild != '*' ) ) + while( ( *str ) && ( *wild != '*' ) ) { - if( ( *wild != *string ) && ( *wild != '?' ) ) + if( ( *wild != *str ) && ( *wild != '?' ) ) return false; - wild++; string++; + wild++; + str++; } - while( *string ) + while( *str ) { if( *wild == '*' ) { if( !*++wild ) return 1; mp = wild; - cp = string + 1; + cp = str + 1; } - else if( ( *wild == *string ) || ( *wild == '?' ) ) + else if( ( *wild == *str ) || ( *wild == '?' ) ) { wild++; - string++; + str++; } else { wild = mp; - string = cp++; + str = cp++; } }