Skip to content

Commit

Permalink
Merge pull request #514 from heitbaum/cast
Browse files Browse the repository at this point in the history
socket: use void cast to allow compile for arm32
  • Loading branch information
sahlberg authored Jan 14, 2025
2 parents ce6116e + a01d42a commit 92e8b40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ rpc_read_from_socket(struct rpc_context *rpc)
}
if (!rpc->is_server_context) {
rpc->rm_xid[0] = count;
rpc->rm_xid[1] = ntohl(*(uint32_t *)&buf[0]);
rpc->pdu = rpc_find_pdu(rpc, ntohl(*(uint32_t *)&buf[0]));
rpc->rm_xid[1] = ntohl(*(uint32_t *)(void *)&buf[0]);
rpc->pdu = rpc_find_pdu(rpc, ntohl(*(uint32_t *)(void *)&buf[0]));
if (rpc->pdu == NULL) {
rpc_set_error(rpc, "Failed to match incoming PDU/XID."
" Ignoring PDU");
Expand Down Expand Up @@ -796,7 +796,7 @@ rpc_read_from_socket(struct rpc_context *rpc)
}

/* Copy the next 4 bytes into inbuf */
*((uint32_t *)rpc->inbuf) = htonl(rpc->rm_xid[1]);
*((uint32_t *)(void *)rpc->inbuf) = htonl(rpc->rm_xid[1]);

/* but set inpos to 0, we will update it above
* that we have already read these 4 bytes in
Expand Down Expand Up @@ -858,7 +858,7 @@ rpc_read_from_socket(struct rpc_context *rpc)
* If the READ failed, bail out here as there is no
* data.
*/
const READ3res *res = (READ3res *) rpc->pdu->zdr_decode_buf;
const READ3res *res = (READ3res *)(void *) rpc->pdu->zdr_decode_buf;
if (res->status != NFS3_OK) {
goto payload_finished;
}
Expand Down

0 comments on commit 92e8b40

Please sign in to comment.