Make this lintable so we can build libc again.
This commit is contained in:
parent
77beb7e099
commit
8f814a0ad6
@ -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 @@ struct in_addr
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user