summaryrefslogtreecommitdiff
path: root/lib/Support/SHA1.cpp
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2016-04-05 20:19:49 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2016-04-05 20:19:49 +0000
commit9a7a3bcf2955decb12cd642133eaa594f3cd121d (patch)
tree78315f78bc0109a6778d35838e0482c165cac9bd /lib/Support/SHA1.cpp
parentfe34a372e1ab527f3102ec0521005a35eecdd229 (diff)
Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes.
Some Include What You Use suggestions were used too. Use anonymous namespaces in source files. Differential revision: http://reviews.llvm.org/D18778 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SHA1.cpp')
-rw-r--r--lib/Support/SHA1.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Support/SHA1.cpp b/lib/Support/SHA1.cpp
index 980c3bbffac..5ff2eed34c4 100644
--- a/lib/Support/SHA1.cpp
+++ b/lib/Support/SHA1.cpp
@@ -1,4 +1,4 @@
-//======- SHA1.h - Private copy of the SHA1 implementation ---*- C++ -* ======//
+//===--- SHA1.h - Private copy of the SHA1 implementation -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -13,12 +13,13 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/SHA1.h"
-using namespace llvm;
-#include <stdint.h>
-#include <string.h>
+#include <cstring>
+
+using namespace llvm;
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
#define SHA_BIG_ENDIAN
@@ -46,10 +47,14 @@ void SHA1::init() {
InternalState.BufferOffset = 0;
}
-static uint32_t rol32(uint32_t number, uint8_t bits) {
+namespace {
+
+uint32_t rol32(uint32_t number, uint8_t bits) {
return ((number << bits) | (number >> (32 - bits)));
}
+} // end anonymous namespace
+
void SHA1::hashBlock() {
uint8_t i;
uint32_t a, b, c, d, e, t;