[git commit] addr.c: get rid of a compiler warning
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Fri Jun 15 12:00:37 UTC 2012
commit: http://git.uclibc.org/uClibc/commit/?id=d33a8aba6a57f0eaed0bc236fdab595d72ed6532
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
libc/inet/addr.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/libc/inet/addr.c b/libc/inet/addr.c
index 363adb6..cd7151a 100644
--- a/libc/inet/addr.c
+++ b/libc/inet/addr.c
@@ -151,18 +151,18 @@ libc_hidden_def(inet_ntoa)
*/
struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host)
{
- in_addr_t addr;
+ struct in_addr in;
if (net < 128)
- addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
+ in.s_addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
else if (net < 65536)
- addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
+ in.s_addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
else if (net < 16777216UL)
- addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
+ in.s_addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
else
- addr = net | host;
- addr = htonl(addr);
- return *(struct in_addr *)&addr;
+ in.s_addr = net | host;
+ in.s_addr = htonl(in.s_addr);
+ return in;
}
libc_hidden_def(inet_makeaddr)
#endif
More information about the uClibc-cvs
mailing list