Use llvm::StringsEqualNoCase instead of strncasecmp.

llvm-svn: 65237
This commit is contained in:
Ted Kremenek 2009-02-21 18:26:02 +00:00
parent c9c50bfc31
commit 97ad7b689e
1 changed files with 5 additions and 8 deletions

View File

@ -35,10 +35,6 @@
using namespace clang; using namespace clang;
#ifdef _MSC_VER
# define strncasecmp _strnicmp
#endif // #ifdef _MSC_VER
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Utility functions. // Utility functions.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -57,6 +53,7 @@ using namespace clang;
// //
using llvm::CStrInCStrNoCase; using llvm::CStrInCStrNoCase;
using llvm::StringsEqualNoCase;
enum NamingConvention { NoConvention, CreateRule, InitRule }; enum NamingConvention { NoConvention, CreateRule, InitRule };
@ -116,17 +113,17 @@ static NamingConvention deriveNamingConvention(const char* s) {
break; break;
case 3: case 3:
// Methods starting with 'new' follow the create rule. // Methods starting with 'new' follow the create rule.
if (AtBeginning && strncasecmp("new", s, len) == 0) if (AtBeginning && StringsEqualNoCase("new", s, len))
C = CreateRule; C = CreateRule;
break; break;
case 4: case 4:
// Methods starting with 'alloc' or contain 'copy' follow the // Methods starting with 'alloc' or contain 'copy' follow the
// create rule // create rule
if ((AtBeginning && strncasecmp("alloc", s, len) == 0) || if ((AtBeginning && StringsEqualNoCase("alloc", s, len)) ||
(strncasecmp("copy", s, len) == 0)) (StringsEqualNoCase("copy", s, len)))
C = CreateRule; C = CreateRule;
else // Methods starting with 'init' follow the init rule. else // Methods starting with 'init' follow the init rule.
if (AtBeginning && strncasecmp("init", s, len) == 0) if (AtBeginning && StringsEqualNoCase("init", s, len))
C = InitRule; C = InitRule;
break; break;
} }