/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace folly {
namespace hash {
-static constexpr auto kAllowUnalignedReads = bool(FOLLY_HAVE_UNALIGNED_READS);
-
//
// short hash ... it could be used on any message,
// but it's used by Spooky just for short messages.
u.p8 = (const uint8_t *)message;
- if (!kAllowUnalignedReads && (u.i & 0x7))
+ if (!kHasUnalignedAccess && (u.i & 0x7))
{
memcpy(buf, message, length);
u.p64 = buf;
end = u.p64 + (length/sc_blockSize)*sc_numVars;
// handle all whole sc_blockSize blocks of bytes
- if (kAllowUnalignedReads || ((u.i & 0x7) == 0))
+ if (kHasUnalignedAccess || ((u.i & 0x7) == 0))
{
while (u.p64 < end)
{
remainder = (length - ((const uint8_t *)end-(const uint8_t *)message));
memcpy(buf, end, remainder);
memset(((uint8_t *)buf)+remainder, 0, sc_blockSize-remainder);
- ((uint8_t *)buf)[sc_blockSize-1] = remainder;
+ ((uint8_t*)buf)[sc_blockSize - 1] = uint8_t(remainder);
// do some final mixing
End(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
// handle all whole blocks of sc_blockSize bytes
end = u.p64 + (length/sc_blockSize)*sc_numVars;
remainder = (uint8_t)(length-((const uint8_t *)end-u.p8));
- if (kAllowUnalignedReads || (u.i & 0x7) == 0)
+ if (kHasUnalignedAccess || (u.i & 0x7) == 0)
{
while (u.p64 < end)
{