diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-21 18:26:02 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-21 18:26:02 +0000 |
commit | 39868cd436927d1392f2c5c5e56e6a996db278d5 (patch) | |
tree | ca6b8459e3e4d7231c2bed8e2eed96d39647d898 /lib/Analysis/CFRefCount.cpp | |
parent | 86f938b3d4a79fb9c337d351c8f3e5f1ff18f1b6 (diff) |
Use llvm::StringsEqualNoCase instead of strncasecmp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65237 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index a602de2dbc..d8c2fb0e96 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -35,10 +35,6 @@ using namespace clang; -#ifdef _MSC_VER -# define strncasecmp _strnicmp -#endif // #ifdef _MSC_VER - //===----------------------------------------------------------------------===// // Utility functions. //===----------------------------------------------------------------------===// @@ -57,6 +53,7 @@ using namespace clang; // using llvm::CStrInCStrNoCase; +using llvm::StringsEqualNoCase; enum NamingConvention { NoConvention, CreateRule, InitRule }; @@ -116,17 +113,17 @@ static NamingConvention deriveNamingConvention(const char* s) { break; case 3: // Methods starting with 'new' follow the create rule. - if (AtBeginning && strncasecmp("new", s, len) == 0) + if (AtBeginning && StringsEqualNoCase("new", s, len)) C = CreateRule; break; case 4: // Methods starting with 'alloc' or contain 'copy' follow the // create rule - if ((AtBeginning && strncasecmp("alloc", s, len) == 0) || - (strncasecmp("copy", s, len) == 0)) + if ((AtBeginning && StringsEqualNoCase("alloc", s, len)) || + (StringsEqualNoCase("copy", s, len))) C = CreateRule; else // Methods starting with 'init' follow the init rule. - if (AtBeginning && strncasecmp("init", s, len) == 0) + if (AtBeginning && StringsEqualNoCase("init", s, len)) C = InitRule; break; } |