mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
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:
parent
8dd6c79a58
commit
ac309256c3
6 changed files with 37 additions and 23 deletions
|
@ -40,18 +40,13 @@
|
|||
struct listener_mgr;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Used to maintain information about processes that wish to be
|
||||
* notified when I/O becomes possible.
|
||||
*/
|
||||
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 */
|
||||
/* Included to suppress warnings about struct socket being declared in the
|
||||
* parameter list. Selinfo reoredered with struct socket. */
|
||||
|
||||
struct selinfo;
|
||||
struct socket;
|
||||
|
||||
#include <sys/socketvar.h>
|
||||
|
||||
#ifdef KERNEL
|
||||
struct proc;
|
||||
|
|
|
@ -40,6 +40,25 @@
|
|||
#include <sys/filedesc.h> /* for struct filedesc */
|
||||
#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.
|
||||
* Contains send and receive buffer queues,
|
||||
|
|
|
@ -125,16 +125,16 @@ void printf __P((const char *, ...));
|
|||
#include <oskitfreebsd.h>
|
||||
#include <oskitdebug.h>
|
||||
|
||||
|
||||
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;
|
||||
int i;
|
||||
va_start(arg, fmt);
|
||||
#ifndef __NTDRIVER__
|
||||
i = vprintf ( fmt, arg );
|
||||
#endif
|
||||
va_end(arg);
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ in_pcbladdr(inp, nam, plocal_sin)
|
|||
* Don't do pcblookup call here; return interface in plocal_sin
|
||||
* 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",
|
||||
(*plocal_sin)->sin_addr.s_addr));
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ int OskitTCPAccept( void *socket,
|
|||
*/
|
||||
so = head->so_q;
|
||||
|
||||
inp = so ? so->so_pcb : 0;
|
||||
inp = so ? (struct inpcb *)so->so_pcb : NULL;
|
||||
if( inp ) {
|
||||
((struct sockaddr_in *)AddrOut)->sin_addr.s_addr =
|
||||
inp->inp_faddr.s_addr;
|
||||
|
@ -381,7 +381,7 @@ int OskitTCPAccept( void *socket,
|
|||
|
||||
/*so->so_state &= ~SS_COMP;*/
|
||||
|
||||
mnam.m_data = &sa;
|
||||
mnam.m_data = (char *)&sa;
|
||||
mnam.m_len = sizeof(sa);
|
||||
|
||||
(void) soaccept(so, &mnam);
|
||||
|
@ -452,7 +452,7 @@ void OskitTCPSetAddress( void *socket,
|
|||
OSK_UINT RemoteAddress,
|
||||
OSK_UI16 RemotePort ) {
|
||||
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_lport = LocalPort;
|
||||
inp->inp_faddr.s_addr = RemoteAddress;
|
||||
|
@ -465,7 +465,7 @@ void OskitTCPGetAddress( void *socket,
|
|||
OSK_UINT *RemoteAddress,
|
||||
OSK_UI16 *RemotePort ) {
|
||||
struct socket *so = socket;
|
||||
struct inpcb *inp = so ? so->so_pcb : 0;
|
||||
struct inpcb *inp = so ? (struct inpcb *)so->so_pcb : NULL;
|
||||
if( inp ) {
|
||||
*LocalAddress = inp->inp_laddr.s_addr;
|
||||
*LocalPort = inp->inp_lport;
|
||||
|
@ -589,7 +589,7 @@ struct ifaddr *ifa_ifwithnet(addr)
|
|||
|
||||
if( ifaddr )
|
||||
{
|
||||
sin = (struct sockaddr *)&ifaddr->ifa_addr;
|
||||
sin = (struct sockaddr_in *)&ifaddr->ifa_addr;
|
||||
|
||||
OS_DbgPrint(OSK_MID_TRACE,("ifaddr->addr = %x\n",
|
||||
sin->sin_addr.s_addr));
|
||||
|
|
|
@ -314,8 +314,8 @@ ifa_ifwithroute(flags, dst, gateway)
|
|||
register struct ifaddr *ifa;
|
||||
|
||||
OS_DbgPrint(OSK_MID_TRACE,("Called: flags %\n", flags));
|
||||
OskitDumpBuffer( dst, sizeof(*dst) );
|
||||
OskitDumpBuffer( gateway, sizeof(*gateway) );
|
||||
OskitDumpBuffer( (void *)dst, sizeof(*dst) );
|
||||
OskitDumpBuffer( (void *)gateway, sizeof(*gateway) );
|
||||
|
||||
if ((flags & RTF_GATEWAY) == 0) {
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue