use auto type when assigning from cast or using new
This commit is contained in:
@ -153,7 +153,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval)
|
||||
|
||||
u.ptr = key;
|
||||
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
|
||||
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
|
||||
const uint32_t *k = (const uint32_t *)key; /* NOLINT read 32-bit chunks */
|
||||
|
||||
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
|
||||
while (length > 12)
|
||||
@ -197,7 +197,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval)
|
||||
|
||||
#else /* make valgrind happy */
|
||||
|
||||
const uint8_t *k8 = (const uint8_t *)k;
|
||||
const uint8_t *k8 = (const uint8_t *)k; /* NOLINT */
|
||||
switch(length)
|
||||
{
|
||||
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
|
||||
@ -218,7 +218,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval)
|
||||
#endif /* !valgrind */
|
||||
|
||||
} else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
|
||||
const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */
|
||||
const uint16_t *k = (const uint16_t *)key; /* NOLINT read 16-bit chunks */
|
||||
const uint8_t *k8;
|
||||
|
||||
/*--------------- all but last block: aligned reads and different mixing */
|
||||
@ -233,7 +233,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval)
|
||||
}
|
||||
|
||||
/*----------------------------- handle the last (probably partial) block */
|
||||
k8 = (const uint8_t *)k;
|
||||
k8 = (const uint8_t *)k; /* NOLINT */
|
||||
switch(length)
|
||||
{
|
||||
case 12: c+=k[4]+(((uint32_t)k[5])<<16);
|
||||
@ -265,7 +265,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval)
|
||||
}
|
||||
|
||||
} else { /* need to read the key one byte at a time */
|
||||
const uint8_t *k = (const uint8_t *)key;
|
||||
const uint8_t *k = (const uint8_t *)key; /* NOLINT */
|
||||
|
||||
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
|
||||
while (length > 12)
|
||||
|
||||
Reference in New Issue
Block a user