summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-15 01:17:17 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:37 +0200
commitd33a8aba6a57f0eaed0bc236fdab595d72ed6532 (patch)
treed5eb3ad2ba229141baaa2fc2d623b9d2bb11231c
parentacda777b7fc450352d02b5b500de3c76acc1e202 (diff)
addr.c: get rid of a compiler warning
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r--libc/inet/addr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c
index 363adb65d..cd7151a45 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