Convert more unsigned char -> uint8_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183053 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2013-05-31 22:34:52 +00:00
parent 92bd43bd4b
commit cbb45aa123
2 changed files with 10 additions and 10 deletions

View File

@ -183,7 +183,7 @@ MD5::MD5()
: a(0x67452301), b(0xefcdab89), c(0x98badcfe), d(0x10325476), hi(0), lo(0) {
}
/// Incrementally add the bytes in Data to the hash.
/// Incrementally add the bytes in \p Data to the hash.
void MD5::update(ArrayRef<uint8_t> Data) {
MD5_u32plus saved_lo;
unsigned long used, free;

View File

@ -20,7 +20,7 @@ using namespace llvm;
namespace {
/// \brief Tests an arbitrary set of bytes passed as \p Input.
void TestMD5Sum(ArrayRef<unsigned char> Input, StringRef Final) {
void TestMD5Sum(ArrayRef<uint8_t> Input, StringRef Final) {
MD5 Hash;
Hash.update(Input);
MD5::MD5Result MD5Res;
@ -31,20 +31,20 @@ void TestMD5Sum(ArrayRef<unsigned char> Input, StringRef Final) {
}
TEST(MD5Test, MD5) {
TestMD5Sum(ArrayRef<unsigned char>((const unsigned char *)"", (size_t) 0),
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"", (size_t) 0),
"d41d8cd98f00b204e9800998ecf8427e");
TestMD5Sum(ArrayRef<unsigned char>((const unsigned char *)"a", (size_t) 1),
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"a", (size_t) 1),
"0cc175b9c0f1b6a831c399e269772661");
TestMD5Sum(ArrayRef<unsigned char>(
(const unsigned char *)"abcdefghijklmnopqrstuvwxyz",
TestMD5Sum(ArrayRef<uint8_t>(
(const uint8_t *)"abcdefghijklmnopqrstuvwxyz",
(size_t) 26),
"c3fcd3d76192e4007dfb496cca67e13b");
TestMD5Sum(ArrayRef<unsigned char>((const unsigned char *)"\0", (size_t) 1),
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"\0", (size_t) 1),
"93b885adfe0da089cdf634904fd59f71");
TestMD5Sum(ArrayRef<unsigned char>((const unsigned char *)"a\0", (size_t) 2),
TestMD5Sum(ArrayRef<uint8_t>((const uint8_t *)"a\0", (size_t) 2),
"4144e195f46de78a3623da7364d04f11");
TestMD5Sum(ArrayRef<unsigned char>(
(const unsigned char *)"abcdefghijklmnopqrstuvwxyz\0",
TestMD5Sum(ArrayRef<uint8_t>(
(const uint8_t *)"abcdefghijklmnopqrstuvwxyz\0",
(size_t) 27),
"81948d1f1554f58cd1a56ebb01f808cb");
}