aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/util
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-08-01 12:40:42 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-08-01 12:40:42 -0700
commit47f3e8c74d390139967cc40e37cf5b433f0b0f9f (patch)
treef43c285be47ec5bc66a25a7fa1c072d2cd32dc97 /src/leveldb/util
parentf66c59650527022b4f7abd98ff0a1a4e4741bd34 (diff)
parentb13a68e129f51b664e33b1894e33ebb7b94cdcc7 (diff)
Update LevelDB with latest Bitcoin-specific patches
Diffstat (limited to 'src/leveldb/util')
-rw-r--r--src/leveldb/util/crc32c.cc4
-rw-r--r--src/leveldb/util/logging.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/leveldb/util/crc32c.cc b/src/leveldb/util/crc32c.cc
index edd61cfd6f..b3f40eeeed 100644
--- a/src/leveldb/util/crc32c.cc
+++ b/src/leveldb/util/crc32c.cc
@@ -288,6 +288,10 @@ static inline uint32_t LE_LOAD32(const uint8_t *p) {
// Determine if the CPU running this program can accelerate the CRC32C
// calculation.
static bool CanAccelerateCRC32C() {
+ if (!port::HasAcceleratedCRC32C())
+ return false;
+
+ // Double-check that the accelerated implementation functions correctly.
// port::AcceleretedCRC32C returns zero when unable to accelerate.
static const char kTestCRCBuffer[] = "TestCRCBuffer";
static const char kBufSize = sizeof(kTestCRCBuffer) - 1;
diff --git a/src/leveldb/util/logging.cc b/src/leveldb/util/logging.cc
index ca6b324403..db6160c8f1 100644
--- a/src/leveldb/util/logging.cc
+++ b/src/leveldb/util/logging.cc
@@ -49,7 +49,7 @@ bool ConsumeDecimalNumber(Slice* in, uint64_t* val) {
uint64_t v = 0;
int digits = 0;
while (!in->empty()) {
- char c = (*in)[0];
+ unsigned char c = (*in)[0];
if (c >= '0' && c <= '9') {
++digits;
const int delta = (c - '0');