Warning cleanups.
authorArt Yerkes <art.yerkes@gmail.com>
Fri, 4 Mar 2005 02:09:43 +0000 (02:09 +0000)
committerArt Yerkes <art.yerkes@gmail.com>
Fri, 4 Mar 2005 02:09:43 +0000 (02:09 +0000)
- #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

reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/select.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/socketvar.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/systm.h
reactos/drivers/lib/oskittcp/oskittcp/in_pcb.c
reactos/drivers/lib/oskittcp/oskittcp/interface.c
reactos/drivers/lib/oskittcp/oskittcp/route.c

index 18d3fc6..128c5e7 100644 (file)
 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;
index 5afe348..ab007da 100644 (file)
 #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,
index 5203cd6..0337f78 100644 (file)
@@ -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;
 }
index 7d0f36b..233835b 100644 (file)
@@ -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));
 
index 151d4ab..1680944 100644 (file)
@@ -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));
index b864966..fb703b7 100644 (file)
@@ -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) {
                /*