[llvm] r206629 - Fix uint -> size_t conversion warning.

Matt Arsenault Matthew.Arsenault at amd.com
Fri Apr 18 11:08:31 PDT 2014


Author: arsenm
Date: Fri Apr 18 13:08:31 2014
New Revision: 206629

URL: http://llvm.org/viewvc/llvm-project?rev=206629&view=rev
Log:
Fix uint -> size_t conversion warning.

This warning is disabled for the LLVM build,
but external users of the header can still
run into this.

Patch by Ke Bai

Modified:
    llvm/trunk/include/llvm/ADT/StringExtras.h

Modified: llvm/trunk/include/llvm/ADT/StringExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringExtras.h?rev=206629&r1=206628&r2=206629&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringExtras.h (original)
+++ llvm/trunk/include/llvm/ADT/StringExtras.h Fri Apr 18 13:08:31 2014
@@ -141,7 +141,7 @@ void SplitString(StringRef Source,
 // better: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
 //   X*33+c -> X*33^c
 static inline unsigned HashString(StringRef Str, unsigned Result = 0) {
-  for (unsigned i = 0, e = Str.size(); i != e; ++i)
+  for (StringRef::size_type i = 0, e = Str.size(); i != e; ++i)
     Result = Result * 33 + (unsigned char)Str[i];
   return Result;
 }





More information about the llvm-commits mailing list