Print this page
6717509 Need to use bswap/bswapq for byte swap of 64-bit integer on x32/x64 (fix lint)
@@ -532,11 +532,11 @@
#endif /* _BIG_ENDIAN */
{
uint64_t tmp;
#ifdef UNALIGNED_POINTERS_PERMITTED
- tmp = htonll(*(uint64_t *)&block[0]);
+ tmp = htonll(*(uint64_t *)(void *)&block[0]);
#else
tmp = (((uint64_t)block[0] << 56) | ((uint64_t)block[1] << 48) |
((uint64_t)block[2] << 40) | ((uint64_t)block[3] << 32) |
((uint64_t)block[4] << 24) | ((uint64_t)block[5] << 16) |
((uint64_t)block[6] << 8) | (uint64_t)block[7]);
@@ -546,11 +546,11 @@
tmp = des_crypt_impl(ksch->ksch_decrypt, tmp, 3);
else
tmp = des_crypt_impl(ksch->ksch_encrypt, tmp, 3);
#ifdef UNALIGNED_POINTERS_PERMITTED
- *(uint64_t *)&out_block[0] = htonll(tmp);
+ *(uint64_t *)(void *)&out_block[0] = htonll(tmp);
#else
out_block[0] = tmp >> 56;
out_block[1] = tmp >> 48;
out_block[2] = tmp >> 40;
out_block[3] = tmp >> 32;
@@ -594,11 +594,11 @@
#endif /* _BIG_ENDIAN */
{
uint64_t tmp;
#ifdef UNALIGNED_POINTERS_PERMITTED
- tmp = htonll(*(uint64_t *)&block[0]);
+ tmp = htonll(*(uint64_t *)(void *)&block[0]);
#else
tmp = (((uint64_t)block[0] << 56) | ((uint64_t)block[1] << 48) |
((uint64_t)block[2] << 40) | ((uint64_t)block[3] << 32) |
((uint64_t)block[4] << 24) | ((uint64_t)block[5] << 16) |
((uint64_t)block[6] << 8) | (uint64_t)block[7]);
@@ -609,11 +609,11 @@
tmp = des_crypt_impl(ksch->ksch_decrypt, tmp, 1);
else
tmp = des_crypt_impl(ksch->ksch_encrypt, tmp, 1);
#ifdef UNALIGNED_POINTERS_PERMITTED
- *(uint64_t *)&out_block[0] = htonll(tmp);
+ *(uint64_t *)(void *)&out_block[0] = htonll(tmp);
#else
out_block[0] = tmp >> 56;
out_block[1] = tmp >> 48;
out_block[2] = tmp >> 40;
out_block[3] = tmp >> 32;
@@ -671,11 +671,11 @@
if (key == NULL)
return (B_FALSE);
#ifdef UNALIGNED_POINTERS_PERMITTED
- key_so_far = htonll(*(uint64_t *)&key[0]);
+ key_so_far = htonll(*(uint64_t *)(void *)&key[0]);
#else
/*
* The code below reverses the bytes on LITTLE_ENDIAN machines.
* On BIG_ENDIAN, the same code copies without reversing
* the bytes.
@@ -697,11 +697,11 @@
return (B_FALSE);
}
if (corrected_key != NULL) {
#ifdef UNALIGNED_POINTERS_PERMITTED
- *(uint64_t *)&corrected_key[0] = htonll(key_so_far);
+ *(uint64_t *)(void *)&corrected_key[0] = htonll(key_so_far);
#else
/*
* The code below reverses the bytes on LITTLE_ENDIAN machines.
* On BIG_ENDIAN, the same code copies without reversing
* the bytes.
@@ -806,11 +806,11 @@
paritied_key = (uint8_t *)aligned_key;
while (strength > i) {
offset = 8 * i;
#ifdef UNALIGNED_POINTERS_PERMITTED
- key_so_far = htonll(*(uint64_t *)&paritied_key[offset]);
+ key_so_far = htonll(*(uint64_t *)(void *)&paritied_key[offset]);
#else
key_so_far = (((uint64_t)paritied_key[offset + 0] << 56) |
((uint64_t)paritied_key[offset + 1] << 48) |
((uint64_t)paritied_key[offset + 2] << 40) |
((uint64_t)paritied_key[offset + 3] << 32) |
@@ -821,11 +821,11 @@
#endif /* UNALIGNED_POINTERS_PERMITTED */
fix_des_parity(&key_so_far);
#ifdef UNALIGNED_POINTERS_PERMITTED
- *(uint64_t *)&paritied_key[offset] = htonll(key_so_far);
+ *(uint64_t *)(void *)&paritied_key[offset] = htonll(key_so_far);
#else
paritied_key[offset + 0] = key_so_far >> 56;
paritied_key[offset + 1] = key_so_far >> 48;
paritied_key[offset + 2] = key_so_far >> 40;
paritied_key[offset + 3] = key_so_far >> 32;
@@ -888,11 +888,12 @@
} else
#endif /* _BIG_ENDIAN */
{
for (i = 0, j = 0; j < keysize; i++, j += 8) {
#ifdef UNALIGNED_POINTERS_PERMITTED
- key_uint64[i] = htonll(*(uint64_t *)&cipherKey[j]);
+ key_uint64[i] =
+ htonll(*(uint64_t *)(void *)&cipherKey[j]);
#else
key_uint64[i] = (((uint64_t)cipherKey[j] << 56) |
((uint64_t)cipherKey[j + 1] << 48) |
((uint64_t)cipherKey[j + 2] << 40) |
((uint64_t)cipherKey[j + 3] << 32) |