[llvm-commits] CVS: llvm/include/llvm/ADT/StringExtras.h

Reid Spencer reid at x10sys.com
Thu Jan 27 23:22:31 PST 2005



Changes in directory llvm/include/llvm/ADT:

StringExtras.h updated: 1.24 -> 1.25
---
Log message:

Convert some old C-style casts to C++ style.


---
Diffs of the changes:  (+2 -2)

 StringExtras.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/ADT/StringExtras.h
diff -u llvm/include/llvm/ADT/StringExtras.h:1.24 llvm/include/llvm/ADT/StringExtras.h:1.25
--- llvm/include/llvm/ADT/StringExtras.h:1.24	Mon Jan  3 19:56:28 2005
+++ llvm/include/llvm/ADT/StringExtras.h	Fri Jan 28 01:22:20 2005
@@ -29,7 +29,7 @@
   if (X == 0) *--BufPtr = '0';  // Handle special case...
 
   while (X) {
-    unsigned char Mod = (unsigned char)X & 15;
+    unsigned char Mod = static_cast<unsigned char>(X) & 15;
     if (Mod < 10)
       *--BufPtr = '0' + Mod;
     else
@@ -109,7 +109,7 @@
   std::string result(S);
   for (unsigned i = 0; i < S.length(); ++i)
     if (isupper(result[i]))
-      result[i] = (char)tolower(result[i]);
+      result[i] = char(tolower(result[i]));
   return result;
 }
 






More information about the llvm-commits mailing list