diff options
author | Alex Wang <alexw@nicira.com> | 2013-07-22 15:47:19 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-07-23 12:34:41 -0700 |
commit | db5a101931c5393d5f9df600559882418d536878 (patch) | |
tree | 3e2820c844a3f20209736adad31ddfaa1b0f5e13 /lib/socket-util.c | |
parent | 550f0db4e0fb3bf9952e8a88b71242491b9dde2a (diff) |
clang: Fix the alignment warning.
This commit fixes the warning issued by 'clang' when pointer is casted
to one with greater alignment.
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/socket-util.c')
-rw-r--r-- | lib/socket-util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/socket-util.c b/lib/socket-util.c index 2ba0fd4a..1d0cede8 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -201,7 +201,8 @@ lookup_hostname(const char *host_name, struct in_addr *addr) switch (getaddrinfo(host_name, NULL, &hints, &result)) { case 0: - *addr = ((struct sockaddr_in *) result->ai_addr)->sin_addr; + *addr = ALIGNED_CAST(struct sockaddr_in *, + result->ai_addr)->sin_addr; freeaddrinfo(result); return 0; @@ -1326,7 +1327,7 @@ recv_data_and_fds(int sock, goto error; } else { size_t n_fds = (p->cmsg_len - CMSG_LEN(0)) / sizeof *fds; - const int *fds_data = (const int *) CMSG_DATA(p); + const int *fds_data = ALIGNED_CAST(const int *, CMSG_DATA(p)); ovs_assert(n_fds > 0); if (n_fds > SOUTIL_MAX_FDS) { |