[cfe-commits] r65237 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Sat Feb 21 10:26:02 PST 2009


Author: kremenek
Date: Sat Feb 21 12:26:02 2009
New Revision: 65237

URL: http://llvm.org/viewvc/llvm-project?rev=65237&view=rev
Log:
Use llvm::StringsEqualNoCase instead of strncasecmp.

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=65237&r1=65236&r2=65237&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Sat Feb 21 12:26:02 2009
@@ -35,10 +35,6 @@
 
 using namespace clang;
 
-#ifdef _MSC_VER
-#  define strncasecmp _strnicmp
-#endif // #ifdef _MSC_VER
-
 //===----------------------------------------------------------------------===//
 // Utility functions.
 //===----------------------------------------------------------------------===//
@@ -57,6 +53,7 @@
 //
 
 using llvm::CStrInCStrNoCase;
+using llvm::StringsEqualNoCase;
 
 enum NamingConvention { NoConvention, CreateRule, InitRule };
 
@@ -116,17 +113,17 @@
       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;
     }





More information about the cfe-commits mailing list