Warning cleanups.

- #define log to something else that isn't a gcc intrinsic
- Move some definitions around in the bsd headers so that proper order is
  maintained between selinfo and socket and functions that take these as
  arguments.
- Miscellaneous casts.

svn path=/trunk/; revision=13811
This commit is contained in:
Art Yerkes 2005-03-04 02:09:43 +00:00
parent 8dd6c79a58
commit ac309256c3
6 changed files with 37 additions and 23 deletions

View file

@ -40,18 +40,13 @@
struct listener_mgr; struct listener_mgr;
#endif #endif
/* /* Included to suppress warnings about struct socket being declared in the
* Used to maintain information about processes that wish to be * parameter list. Selinfo reoredered with struct socket. */
* notified when I/O becomes possible.
*/ struct selinfo;
struct selinfo { struct socket;
#if defined(OSKIT)
struct listener_mgr *si_sel; #include <sys/socketvar.h>
#endif /* OSKIT */
pid_t si_pid; /* process to be notified */
short si_flags; /* see below */
};
#define SI_COLL 0x0001 /* collision occurred */
#ifdef KERNEL #ifdef KERNEL
struct proc; struct proc;

View file

@ -40,6 +40,25 @@
#include <sys/filedesc.h> /* for struct filedesc */ #include <sys/filedesc.h> /* for struct filedesc */
#include <sys/select.h> /* for struct selinfo */ #include <sys/select.h> /* for struct selinfo */
/* Warning suppression */
struct sockaddr;
/*
* Used to maintain information about processes that wish to be
* notified when I/O becomes possible.
*
* Moved from sys/select.h and replaced with an #include.
*/
struct selinfo {
#if defined(OSKIT)
struct listener_mgr *si_sel;
#endif /* OSKIT */
pid_t si_pid; /* process to be notified */
short si_flags; /* see below */
};
#define SI_COLL 0x0001 /* collision occurred */
/* /*
* Kernel structure per socket. * Kernel structure per socket.
* Contains send and receive buffer queues, * Contains send and receive buffer queues,

View file

@ -125,16 +125,16 @@ void printf __P((const char *, ...));
#include <oskitfreebsd.h> #include <oskitfreebsd.h>
#include <oskitdebug.h> #include <oskitdebug.h>
int __cdecl vprintf(const char *, va_list); int __cdecl vprintf(const char *, va_list);
static inline int log ( int blah, const char* fmt, ... ) #define log bsd_log
static inline int bsd_log ( int blah, const char* fmt, ... )
{ {
va_list arg; va_list arg;
int i; int i;
va_start(arg, fmt); va_start(arg, fmt);
#ifndef __NTDRIVER__
i = vprintf ( fmt, arg ); i = vprintf ( fmt, arg );
#endif
va_end(arg); va_end(arg);
return i; return i;
} }

View file

@ -312,7 +312,7 @@ in_pcbladdr(inp, nam, plocal_sin)
* Don't do pcblookup call here; return interface in plocal_sin * Don't do pcblookup call here; return interface in plocal_sin
* and exit to caller, that will do the lookup. * and exit to caller, that will do the lookup.
*/ */
*plocal_sin = ia->ia_ifa.ifa_addr; *plocal_sin = (struct sockaddr_in *)ia->ia_ifa.ifa_addr;
OS_DbgPrint(OSK_MID_TRACE,("plocal sin %x\n", OS_DbgPrint(OSK_MID_TRACE,("plocal sin %x\n",
(*plocal_sin)->sin_addr.s_addr)); (*plocal_sin)->sin_addr.s_addr));

View file

@ -365,7 +365,7 @@ int OskitTCPAccept( void *socket,
*/ */
so = head->so_q; so = head->so_q;
inp = so ? so->so_pcb : 0; inp = so ? (struct inpcb *)so->so_pcb : NULL;
if( inp ) { if( inp ) {
((struct sockaddr_in *)AddrOut)->sin_addr.s_addr = ((struct sockaddr_in *)AddrOut)->sin_addr.s_addr =
inp->inp_faddr.s_addr; inp->inp_faddr.s_addr;
@ -381,7 +381,7 @@ int OskitTCPAccept( void *socket,
/*so->so_state &= ~SS_COMP;*/ /*so->so_state &= ~SS_COMP;*/
mnam.m_data = &sa; mnam.m_data = (char *)&sa;
mnam.m_len = sizeof(sa); mnam.m_len = sizeof(sa);
(void) soaccept(so, &mnam); (void) soaccept(so, &mnam);
@ -452,7 +452,7 @@ void OskitTCPSetAddress( void *socket,
OSK_UINT RemoteAddress, OSK_UINT RemoteAddress,
OSK_UI16 RemotePort ) { OSK_UI16 RemotePort ) {
struct socket *so = socket; struct socket *so = socket;
struct inpcb *inp = so->so_pcb; struct inpcb *inp = (struct inpcb *)so->so_pcb;
inp->inp_laddr.s_addr = LocalAddress; inp->inp_laddr.s_addr = LocalAddress;
inp->inp_lport = LocalPort; inp->inp_lport = LocalPort;
inp->inp_faddr.s_addr = RemoteAddress; inp->inp_faddr.s_addr = RemoteAddress;
@ -465,7 +465,7 @@ void OskitTCPGetAddress( void *socket,
OSK_UINT *RemoteAddress, OSK_UINT *RemoteAddress,
OSK_UI16 *RemotePort ) { OSK_UI16 *RemotePort ) {
struct socket *so = socket; struct socket *so = socket;
struct inpcb *inp = so ? so->so_pcb : 0; struct inpcb *inp = so ? (struct inpcb *)so->so_pcb : NULL;
if( inp ) { if( inp ) {
*LocalAddress = inp->inp_laddr.s_addr; *LocalAddress = inp->inp_laddr.s_addr;
*LocalPort = inp->inp_lport; *LocalPort = inp->inp_lport;
@ -589,7 +589,7 @@ struct ifaddr *ifa_ifwithnet(addr)
if( ifaddr ) if( ifaddr )
{ {
sin = (struct sockaddr *)&ifaddr->ifa_addr; sin = (struct sockaddr_in *)&ifaddr->ifa_addr;
OS_DbgPrint(OSK_MID_TRACE,("ifaddr->addr = %x\n", OS_DbgPrint(OSK_MID_TRACE,("ifaddr->addr = %x\n",
sin->sin_addr.s_addr)); sin->sin_addr.s_addr));

View file

@ -314,8 +314,8 @@ ifa_ifwithroute(flags, dst, gateway)
register struct ifaddr *ifa; register struct ifaddr *ifa;
OS_DbgPrint(OSK_MID_TRACE,("Called: flags %\n", flags)); OS_DbgPrint(OSK_MID_TRACE,("Called: flags %\n", flags));
OskitDumpBuffer( dst, sizeof(*dst) ); OskitDumpBuffer( (void *)dst, sizeof(*dst) );
OskitDumpBuffer( gateway, sizeof(*gateway) ); OskitDumpBuffer( (void *)gateway, sizeof(*gateway) );
if ((flags & RTF_GATEWAY) == 0) { if ((flags & RTF_GATEWAY) == 0) {
/* /*