diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-08-27 20:57:30 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-08-27 20:57:30 +0000 |
commit | f8df79dbbaa090e59521c7c98be8eec71e1a5ead (patch) | |
tree | 235af3fd85520e01508630c9e3ae89bbaf2df6d8 | |
parent | 577822c05ffeb7be0bad4ecfcb0f5ee394313e40 (diff) | |
download | glibc-f8df79dbbaa090e59521c7c98be8eec71e1a5ead.zip glibc-f8df79dbbaa090e59521c7c98be8eec71e1a5ead.tar.gz glibc-f8df79dbbaa090e59521c7c98be8eec71e1a5ead.tar.bz2 |
Update.
2003-08-27 Jakub Jelinek <jakub@redhat.com>
* inet/inet_mkadr.c (inet_makeaddr): Optimize.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | inet/inet_mkadr.c | 14 |
2 files changed, 11 insertions, 7 deletions
@@ -1,3 +1,7 @@ +2003-08-27 Jakub Jelinek <jakub@redhat.com> + + * inet/inet_mkadr.c (inet_makeaddr): Optimize. + 2003-08-27 Ulrich Drepper <drepper@redhat.com> * include/stdio.h: Add declarations for __builtin_fwrite and diff --git a/inet/inet_mkadr.c b/inet/inet_mkadr.c index 12c9590..d8d92da 100644 --- a/inet/inet_mkadr.c +++ b/inet/inet_mkadr.c @@ -43,17 +43,17 @@ struct in_addr inet_makeaddr(net, host) in_addr_t net, host; { - u_int32_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 < 16777216L) - 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) |