Print this page
6717509 Need to use bswap/bswapq for byte swap of 64-bit integer on x32/x64 (fix lint)

@@ -397,12 +397,12 @@
         {
         /*
          * Read input block and place in left/right in big-endian order.
          */
 #ifdef UNALIGNED_POINTERS_PERMITTED
-        left = htonl(*(uint32_t *)&block[0]);
-        right = htonl(*(uint32_t *)&block[4]);
+        left = htonl(*(uint32_t *)(void *)&block[0]);
+        right = htonl(*(uint32_t *)(void *)&block[4]);
 #else
         left = ((uint32_t)block[0] << 24)
             | ((uint32_t)block[1] << 16)
             | ((uint32_t)block[2] << 8)
             | (uint32_t)block[3];

@@ -445,12 +445,12 @@
         } else
 #endif
         {
                 /* Put the block back into the user's block with final swap */
 #ifdef UNALIGNED_POINTERS_PERMITTED
-                *(uint32_t *)&out_block[0] = htonl(left);
-                *(uint32_t *)&out_block[4] = htonl(right);
+                *(uint32_t *)(void *)&out_block[0] = htonl(left);
+                *(uint32_t *)(void *)&out_block[4] = htonl(right);
 #else
                 out_block[0] = left >> 24;
                 out_block[1] = left >> 16;
                 out_block[2] = left >> 8;
                 out_block[3] = left;

@@ -494,12 +494,12 @@
         {
         /*
          * Read input block and place in left/right in big-endian order.
          */
 #ifdef UNALIGNED_POINTERS_PERMITTED
-        left = htonl(*(uint32_t *)&block[0]);
-        right = htonl(*(uint32_t *)&block[4]);
+        left = htonl(*(uint32_t *)(void *)&block[0]);
+        right = htonl(*(uint32_t *)(void *)&block[4]);
 #else
         left = ((uint32_t)block[0] << 24)
             | ((uint32_t)block[1] << 16)
             | ((uint32_t)block[2] << 8)
             | (uint32_t)block[3];

@@ -542,12 +542,12 @@
         } else
 #endif
         {
         /* Put the block back into the user's block with final swap */
 #ifdef UNALIGNED_POINTERS_PERMITTED
-                *(uint32_t *)&out_block[0] = htonl(left);
-                *(uint32_t *)&out_block[4] = htonl(right);
+                *(uint32_t *)(void *)&out_block[0] = htonl(left);
+                *(uint32_t *)(void *)&out_block[4] = htonl(right);
 #else
                 out_block[0] = left >> 24;
                 out_block[1] = left >> 16;
                 out_block[2] = left >> 8;
                 out_block[3] = left;