Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/net Make this lintable so we can build libc again.



details:   https://anonhg.NetBSD.org/src/rev/daed2e82794c
branches:  trunk
changeset: 522277:daed2e82794c
user:      augustss <augustss%NetBSD.org@localhost>
date:      Thu Feb 14 22:10:56 2002 +0000

description:
Make this lintable so we can build libc again.

diffstat:

 lib/libc/net/inet_makeaddr.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 288b815606c8 -r daed2e82794c lib/libc/net/inet_makeaddr.c
--- a/lib/libc/net/inet_makeaddr.c      Thu Feb 14 21:58:30 2002 +0000
+++ b/lib/libc/net/inet_makeaddr.c      Thu Feb 14 22:10:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet_makeaddr.c,v 1.9 2002/02/14 19:53:00 martin Exp $ */
+/*     $NetBSD: inet_makeaddr.c,v 1.10 2002/02/14 22:10:56 augustss Exp $      */
 
 /*
  * Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)inet_makeaddr.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: inet_makeaddr.c,v 1.9 2002/02/14 19:53:00 martin Exp $");
+__RCSID("$NetBSD: inet_makeaddr.c,v 1.10 2002/02/14 22:10:56 augustss Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -59,16 +59,18 @@
 inet_makeaddr(net, host)
        u_long net, host;
 {
+       in_addr_t anet = (in_addr_t)net;
+       in_addr_t ahost = (in_addr_t)host;
        in_addr_t addr;
 
        if (net < 128)
-               addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
+               addr = (anet << IN_CLASSA_NSHIFT) | (ahost & IN_CLASSA_HOST);
        else if (net < 65536)
-               addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
+               addr = (anet << IN_CLASSB_NSHIFT) | (ahost & IN_CLASSB_HOST);
        else if (net < 16777216L)
-               addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
+               addr = (anet << IN_CLASSC_NSHIFT) | (ahost & IN_CLASSC_HOST);
        else
-               addr = net | host;
+               addr = anet | ahost;
        addr = htonl((u_int32_t)addr);
        return (*(struct in_addr *)(void *)&addr);
 }



Home | Main Index | Thread Index | Old Index