VirtualBox

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

slirp: warnings

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

Legend:

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

    r62511 r63014  
    175175{
    176176    struct response *res;
    177     size_t mlen;
     177    u_int mlen;
    178178    int rc;
    179179
     
    380380
    381381    m->m_len = 0;
    382     ok = m_append(pData, m, res->end, (c_caddr_t)res->buf);
     382    ok = m_append(pData, m, (int)res->end, (c_caddr_t)res->buf);
    383383    if (!ok)
    384384    {
     
    536536    if (off < res->qlen)
    537537    {
    538         int trailer = res->qlen - off;
     538        ssize_t trailer = res->qlen - off;
    539539
    540540        LogDbg(("NAT: hostres: question %zu < mlen %zu\n", off, res->qlen));
     
    751751
    752752  out:
    753     pHdr->ancount = RT_H2N_U16(nanswers);
     753    pHdr->ancount = RT_H2N_U16((uint16_t)nanswers);
    754754    return VINF_SUCCESS;
    755755}
     
    768768    size_t nanswers;
    769769    ssize_t nbytes;
    770     int i;
    771770
    772771    pHdr = (struct dnsmsg_header *)res->buf;
     
    791790     */
    792791    {
    793         PDNSMAPPINGENTRY pReverseMapping = getDNSMapByAddr(res->pData, &in_addr_arpa.s_addr);
     792        PDNSMAPPINGENTRY pReverseMapping = getDNSMapByAddr(res->pData, (const uint32_t *)&in_addr_arpa.s_addr);
    794793        if (pReverseMapping != NULL)
    795794        {
     
    813812    if (h == NULL)
    814813    {
     814#ifdef RT_OS_WINDOWS
     815        h = gethostbyaddr((const char *)&in_addr_arpa, sizeof(struct in_addr), AF_INET);
     816#else
    815817        h = gethostbyaddr(&in_addr_arpa, sizeof(struct in_addr), AF_INET);
     818#endif
    816819    }
    817820
     
    848851
    849852  out:
    850     pHdr->ancount = RT_H2N_U16(nanswers);
     853    pHdr->ancount = RT_H2N_U16((uint16_t)nanswers);
    851854    return VINF_SUCCESS;
    852855}
     
    11891192    struct label *l;
    11901193    int i;
     1194    RT_ZERO(addr); /* makes MSC happy*/
    11911195
    11921196    l = root;
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias.c

    r61905 r63014  
    162162    uint8_t *c = p;
    163163
    164 #if BYTE_ORDER == LITTLE_ENDIAN
     164#ifdef RT_LITTLE_ENDIAN //BYTE_ORDER == LITTLE_ENDIAN
    165165    uint16_t s1 = ((uint16_t)c[1] << 8) + (uint16_t)c[0];
    166166    uint16_t s2 = ((uint16_t)c[3] << 8) + (uint16_t)c[2];
     
    977977    int proxy_type, error;
    978978    u_short dest_port;
    979     u_short proxy_server_port;
     979    u_short proxy_server_port = 0; /* Shut up MSC. */
    980980    struct in_addr dest_address;
    981981    struct in_addr proxy_server_address;
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c

    r52712 r63014  
    22782278#else
    22792279        Log2(("NAT: PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n"));
    2280         la->logDesc = (void *)1; /* XXX: in vbox we don't use this param */
     2280        la->logDesc = (void *)(uintptr_t)1; /* XXX: in vbox we don't use this param */
    22812281#endif
    22822282        la->packetAliasMode |= PKT_ALIAS_LOG;
  • trunk/src/VBox/Devices/Network/slirp/tftp.c

    r62511 r63014  
    254254    char *pszTftpRRQRaw;
    255255    size_t idxTftpRRQRaw = 0;
    256     int cbTftpRRQRaw = 0;
     256    ssize_t cbTftpRRQRaw = 0;
    257257    int fWithArg = 0;
    258258    int idxOptionArg = 0;
     
    263263    pszTftpRRQRaw = (char *)&pcTftpIpHeader->Core;
    264264    cbTftpRRQRaw = RT_H2N_U16(pcTftpIpHeader->UdpHdr.uh_ulen) + sizeof(struct ip) - RT_OFFSETOF(TFTPIPHDR, Core);
    265     while(cbTftpRRQRaw)
     265    while (cbTftpRRQRaw)
    266266    {
    267267        idxTftpRRQRaw = RTStrNLen(pszTftpRRQRaw, 512 - idxTftpRRQRaw) + 1;
     
    327327        }
    328328        pszTftpRRQRaw += idxTftpRRQRaw;
    329         cbTftpRRQRaw -= idxTftpRRQRaw;
     329        cbTftpRRQRaw  -= idxTftpRRQRaw;
    330330    }
    331331
     
    538538{
    539539    char aszOptionBuffer[256];
    540     size_t iOptLength = 0;
     540    size_t iOptLength;
    541541    int rc = VINF_SUCCESS;
    542542    int cbMBufCurrent = pMBuf->m_len;
     
    546546
    547547    RT_ZERO(aszOptionBuffer);
    548     iOptLength += RTStrPrintf(aszOptionBuffer, 256 , "%s", pszOptName) + 1;
     548    iOptLength  = RTStrPrintf(aszOptionBuffer, 256 , "%s", pszOptName) + 1;
    549549    iOptLength += RTStrPrintf(aszOptionBuffer + iOptLength, 256 - iOptLength , "%llu", u64OptValue) + 1;
    550550    if (iOptLength > M_TRAILINGSPACE(pMBuf))
     
    552552    else
    553553    {
    554         pMBuf->m_len += iOptLength;
    555         m_copyback(pData, pMBuf, cbMBufCurrent, iOptLength, aszOptionBuffer);
     554        pMBuf->m_len += (int)iOptLength;
     555        m_copyback(pData, pMBuf, cbMBufCurrent, (int)iOptLength, aszOptionBuffer);
    556556    }
    557557    LogFlowFuncLeaveRC(rc);
     
    609609    struct mbuf *m = NULL;
    610610    PTFTPIPHDR pTftpIpHeader = NULL;
     611    u_int cbMsg = (u_int)strlen(msg) + 1; /* ending zero */
    611612
    612613    LogFlowFunc(("ENTER: errorcode: %RX16, msg: %s\n", errorcode, msg));
     
    619620
    620621    m->m_data += if_maxlinkhdr;
    621     m->m_len = sizeof(TFTPIPHDR)
    622              + strlen(msg) + 1; /* ending zero */
     622    m->m_len = sizeof(TFTPIPHDR) + cbMsg;
    623623    m->m_pkthdr.header = mtod(m, void *);
    624624    pTftpIpHeader = mtod(m, PTFTPIPHDR);
     
    627627    pTftpIpHeader->Core.u16TftpOpCode = RT_H2N_U16(errorcode);
    628628
    629     m_copyback(pData, m, sizeof(TFTPIPHDR), strlen(msg) + 1 /* copy ending zerro*/, (c_caddr_t)msg);
     629    m_copyback(pData, m, sizeof(TFTPIPHDR), cbMsg, (c_caddr_t)msg);
    630630
    631631    tftpSend(pData, pTftpSession, m, pcTftpIpHeaderRecv);
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