Fix declaration of offset

pull/4415/head
Kim Kulling 2022-02-24 17:04:39 +01:00 committed by GitHub
parent cf96639119
commit 0dc24ab3a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -75,6 +75,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t hash = 0) { inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t hash = 0) {
uint32_t tmp; uint32_t tmp;
int rem; int rem;
size_t offset;
if (!data) return 0; if (!data) return 0;
if (!len)len = (uint32_t)::strlen(data); if (!len)len = (uint32_t)::strlen(data);
@ -95,7 +96,7 @@ int rem;
switch (rem) { switch (rem) {
case 3: hash += get16bits (data); case 3: hash += get16bits (data);
hash ^= hash << 16; hash ^= hash << 16;
size_t offset = static_cast<size_t>(sizeof(uint16_t)); offset = static_cast<size_t>(sizeof(uint16_t));
if (offset < 0) { if (offset < 0) {
return 0; return 0;
} }