VirtualBox

Changeset 63013 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Aug 4, 2016 9:42:42 PM (8 years ago)
Author:
vboxsync
Message:

slirp: warnings

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r62692 r63013  
    135135
    136136void
    137 so_init()
     137so_init(void)
    138138{
    139139}
     
    163163 */
    164164struct socket *
    165 socreate()
     165socreate(void)
    166166{
    167167    struct socket *so;
     
    241241    int n, nn, lss, total;
    242242    struct sbuf *sb = &so->so_snd;
    243     size_t len = sb->sb_datalen - sb->sb_cc;
     243    u_int len = sb->sb_datalen - sb->sb_cc;
    244244    struct iovec iov[2];
    245245    int mss = so->so_tcpcb->t_maxseg;
     
    392392     * A return of -1 wont (shouldn't) happen, since it didn't happen above
    393393     */
    394     if (n == 2 && nn == iov[0].iov_len)
     394    if (n == 2 && (unsigned)nn == iov[0].iov_len)
    395395    {
    396396        int ret;
     
    530530    int n, nn;
    531531    struct sbuf *sb = &so->so_rcv;
    532     size_t len = sb->sb_cc;
     532    u_int len = sb->sb_cc;
    533533    struct iovec iov[2];
    534534
     
    634634
    635635#ifndef HAVE_READV
    636     if (n == 2 && nn == iov[0].iov_len)
     636    if (n == 2 && (unsigned)nn == iov[0].iov_len)
    637637    {
    638638        int ret;
     
    694694#endif /* !RT_OS_WINDOWS */
    695695    {
    696         static uint8_t au8Buf[64 * 1024];
     696        static char achBuf[64 * 1024];
    697697
    698698        /* A "normal" UDP packet */
     
    724724
    725725        /* large packets will spill into a temp buffer */
    726         iov[1].iov_base = au8Buf;
    727         iov[1].iov_len = sizeof(au8Buf);
     726        iov[1].iov_base = achBuf;
     727        iov[1].iov_len = sizeof(achBuf);
    728728
    729729#if !defined(RT_OS_WINDOWS)
     
    742742        {
    743743            DWORD nbytes; /* NB: can't use nread b/c of different size */
    744             DWORD flags;
     744            DWORD flags = 0;
    745745            int status;
    746 
    747             flags = 0;
    748             status = WSARecvFrom(so->s, iov, 2, &nbytes, &flags,
     746            AssertCompile(sizeof(WSABUF) == sizeof(struct iovec));
     747            AssertCompileMembersSameSizeAndOffset(WSABUF, len, struct iovec, iov_len);
     748            AssertCompileMembersSameSizeAndOffset(WSABUF, buf, struct iovec, iov_base);
     749            status = WSARecvFrom(so->s, (WSABUF *)&iov[0], 2, &nbytes, &flags,
    749750                                 (struct sockaddr *)&addr, &addrlen,
    750751                                 NULL, NULL);
  • trunk/src/VBox/Devices/Network/slirp/tcp_input.c

    r62511 r63013  
    294294    caddr_t optp = NULL;
    295295    int optlen = 0;
    296     int len, tlen, off;
     296    int len, off;
     297    int tlen = 0; /* Shut up MSC (didn't check whether MSC was right). */
    297298    register struct tcpcb *tp = 0;
    298299    register int tiflags;
     
    303304    u_long tiwin;
    304305/*  int ts_present = 0; */
    305     size_t ohdrlen;
     306    unsigned ohdrlen;
    306307    uint8_t ohdr[60 + 8]; /* max IP header plus 8 bytes of payload for icmp */
    307308
     
    360361
    361362    /* ip_input() subtracts iphlen from ip::ip_len */
    362     AssertStmt((ip->ip_len + iphlen == m_length(m, NULL)), goto drop);
     363    AssertStmt(ip->ip_len + iphlen == (ssize_t)m_length(m, NULL), goto drop);
    363364    if (RT_UNLIKELY(ip->ip_len < sizeof(struct tcphdr)))
    364365    {
     
    17841785    {
    17851786        struct ip *oip;
    1786         size_t ohdrlen;
     1787        unsigned ohdrlen;
    17871788        struct mbuf *m;
    17881789
  • trunk/src/VBox/Devices/Network/slirp/tcp_output.c

    r62511 r63013  
    439439         * a PUSH comes in.)
    440440         */
    441         if (off + len == SBUF_LEN(&so->so_snd))
     441        if (off + len == (ssize_t)SBUF_LEN(&so->so_snd))
    442442            flags |= TH_PUSH;
    443443    }
     
    540540    {
    541541        memcpy((caddr_t)(ti + 1), (caddr_t)opt, optlen);
    542         ti->ti_off = (sizeof (struct tcphdr) + optlen) >> 2;
     542        ti->ti_off = (uint8_t)((sizeof (struct tcphdr) + optlen) >> 2);
    543543    }
    544544    ti->ti_flags = flags;
  • trunk/src/VBox/Devices/Network/slirp/tcp_subr.c

    r62511 r63013  
    315315
    316316void
    317 tcp_drain()
     317tcp_drain(void)
    318318{
    319319    /* XXX */
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r62511 r63013  
    334334         * can't use IP_HDRINCL here as it's only valid for SOCK_RAW.
    335335         */
    336 #     define USE_DF_OPTION(_Optname)                    \
    337         const int dfopt = _Optname;                     \
    338         const char * const dfoptname = #_Optname;
     336#     define USE_DF_OPTION(_Optname) \
     337        const int dfopt = _Optname
    339338#if   defined(IP_MTU_DISCOVER)
    340339        USE_DF_OPTION(IP_MTU_DISCOVER);
     
    434433    memset(ui->ui_x1, 0, 9);
    435434    ui->ui_pr = IPPROTO_UDP;
    436     ui->ui_len = RT_H2N_U16(mlen - sizeof(struct ip));
     435    ui->ui_len = RT_H2N_U16((uint16_t)(mlen - sizeof(struct ip)));
    437436    /* XXXXX Check for from-one-location sockets, or from-any-location sockets */
    438437    ui->ui_src = saddr->sin_addr;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette