[llvm] r183051 - Move "unsigned char" -> "uint8_t".

Eric Christopher echristo at gmail.com
Fri May 31 15:34:34 PDT 2013


Author: echristo
Date: Fri May 31 17:34:34 2013
New Revision: 183051

URL: http://llvm.org/viewvc/llvm-project?rev=183051&view=rev
Log:
Move "unsigned char" -> "uint8_t".

Modified:
    llvm/trunk/include/llvm/Support/MD5.h
    llvm/trunk/lib/Support/MD5.cpp

Modified: llvm/trunk/include/llvm/Support/MD5.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MD5.h?rev=183051&r1=183050&r2=183051&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MD5.h (original)
+++ llvm/trunk/include/llvm/Support/MD5.h Fri May 31 17:34:34 2013
@@ -41,16 +41,16 @@ class MD5 {
 
   MD5_u32plus a, b, c, d;
   MD5_u32plus hi, lo;
-  unsigned char buffer[64];
+  uint8_t buffer[64];
   MD5_u32plus block[16];
 
 public:
-  typedef unsigned char MD5Result[16];
+  typedef uint8_t MD5Result[16];
 
   MD5();
 
   /// \brief Updates the hash for arguments provided.
-  void update(ArrayRef<unsigned char> Data);
+  void update(ArrayRef<uint8_t> Data);
 
   /// \brief Finishes off the hash and puts the result in result.
   void final(MD5Result &result);
@@ -60,7 +60,7 @@ public:
   static void stringifyResult(MD5Result &Res, SmallString<32> &Str);
 
 private:
-  const unsigned char *body(ArrayRef<unsigned char> Data);
+  const uint8_t *body(ArrayRef<uint8_t> Data);
 };
 
 }

Modified: llvm/trunk/lib/Support/MD5.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MD5.cpp?rev=183051&r1=183050&r2=183051&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MD5.cpp (original)
+++ llvm/trunk/lib/Support/MD5.cpp Fri May 31 17:34:34 2013
@@ -72,8 +72,8 @@ namespace llvm {
 
 /// \brief This processes one or more 64-byte data blocks, but does NOT update
 ///the bit counters.  There are no alignment requirements.
-const unsigned char *MD5::body(ArrayRef<unsigned char> Data) {
-  const unsigned char *ptr;
+const uint8_t *MD5::body(ArrayRef<uint8_t> Data) {
+  const uint8_t *ptr;
   MD5_u32plus a, b, c, d;
   MD5_u32plus saved_a, saved_b, saved_c, saved_d;
   unsigned long Size = Data.size();
@@ -184,10 +184,10 @@ MD5::MD5()
 }
 
 /// Incrementally add \p size of \p data to the hash.
-void MD5::update(ArrayRef<unsigned char> Data) {
+void MD5::update(ArrayRef<uint8_t> Data) {
   MD5_u32plus saved_lo;
   unsigned long used, free;
-  const unsigned char *Ptr = Data.data();
+  const uint8_t *Ptr = Data.data();
   unsigned long Size = Data.size();
 
   saved_lo = lo;
@@ -208,11 +208,11 @@ void MD5::update(ArrayRef<unsigned char>
     memcpy(&buffer[used], Ptr, free);
     Ptr = Ptr + free;
     Size -= free;
-    body(ArrayRef<unsigned char>(buffer, 64));
+    body(ArrayRef<uint8_t>(buffer, 64));
   }
 
   if (Size >= 64) {
-    Ptr = body(ArrayRef<unsigned char>(Ptr, Size & ~(unsigned long) 0x3f));
+    Ptr = body(ArrayRef<uint8_t>(Ptr, Size & ~(unsigned long) 0x3f));
     Size &= 0x3f;
   }
 
@@ -232,7 +232,7 @@ void MD5::final(MD5Result &result) {
 
   if (free < 8) {
     memset(&buffer[used], 0, free);
-    body(ArrayRef<unsigned char>(buffer, 64));
+    body(ArrayRef<uint8_t>(buffer, 64));
     used = 0;
     free = 64;
   }
@@ -249,7 +249,7 @@ void MD5::final(MD5Result &result) {
   buffer[62] = hi >> 16;
   buffer[63] = hi >> 24;
 
-  body(ArrayRef<unsigned char>(buffer, 64));
+  body(ArrayRef<uint8_t>(buffer, 64));
 
   result[0] = a;
   result[1] = a >> 8;





More information about the llvm-commits mailing list