VirtualBox

Changeset 43753 in vbox


Ignore:
Timestamp:
Oct 26, 2012 9:36:31 AM (12 years ago)
Author:
vboxsync
Message:

src-client/ConsoleImpl2.cpp: Build fix r81663.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r43750 r43753  
    466466/** Helper that finds out the next SATA port used
    467467 */
    468 static int GetNextUsedSataPort(int aSataPortUsed[30], int iBaseVal, int iSize)
     468static LONG GetNextUsedSataPort(LONG aSataPortUsed[30], LONG lBaseVal, uint32_t u32Size)
    469469{
    470     int iNextPortUsed = 30;
    471     for (size_t j = 0; j < iSize; ++j)
     470    LONG lNextPortUsed = 30;
     471    for (size_t j = 0; j < u32Size; ++j)
    472472    {
    473         if(aSataPortUsed[j] > iBaseVal &&
    474            aSataPortUsed[j] <= iNextPortUsed)
    475            iNextPortUsed = aSataPortUsed[j];
     473        if(aSataPortUsed[j] > lBaseVal &&
     474           aSataPortUsed[j] <= lNextPortUsed)
     475           lNextPortUsed = aSataPortUsed[j];
    476476    }
    477     return iNextPortUsed;
     477    return lNextPortUsed;
    478478}
    479479
     
    16321632                        { "SataLUN1", "SataLUN2", "SataLUN3", "SataLUN4" };
    16331633
    1634                         int iPortNum = 0;
    1635                         uint32_t u32PortLUN[MAX_SATA_LUN_COUNT];
    1636                         uint32_t u32PortUsed[MAX_SATA_PORTS];
     1634                        LONG lPortNum = 0;
     1635                        LONG lPortLUN[MAX_SATA_LUN_COUNT];
     1636                        LONG lPortUsed[MAX_SATA_PORTS];
    16371637                        uint32_t u32HDSataPortCount = 0;
    16381638                        uint32_t u32MaxPortCount = MAX_SATA_LUN_COUNT;
    1639                         uint32_t u32NumAttachments = 0;
     1639                        size_t uNumAttachments = 0;
    16401640                        DeviceType_T lType;
    16411641                        com::SafeIfaceArray<IMediumAttachment> atts;
    16421642
    16431643                        /* init to max value */
    1644                         u32PortLUN[0] = MAX_SATA_PORTS;
     1644                        lPortLUN[0] = MAX_SATA_PORTS;
    16451645
    16461646                        if (pBiosCfg)
     
    16521652                        hrc = pMachine->GetMediumAttachmentsOfController(controllerName.raw(),
    16531653                                                            ComSafeArrayAsOutParam(atts));  H();
    1654                         u32NumAttachments = atts.size();
    1655                         if (u32NumAttachments > MAX_SATA_PORTS)
     1654                        uNumAttachments = atts.size();
     1655                        if (uNumAttachments > MAX_SATA_PORTS)
    16561656                        {
    1657                             LogRel(("Number of Sata Port Attachments > Max=%d.\n", u32NumAttachments));
    1658                             u32NumAttachments =  MAX_SATA_PORTS;
     1657                            LogRel(("Number of Sata Port Attachments > Max=%d.\n", uNumAttachments));
     1658                            uNumAttachments =  MAX_SATA_PORTS;
    16591659                        }
    16601660
     
    16621662                         * HD is attached.
    16631663                         */
    1664                         for (size_t j = 0; j < u32NumAttachments; ++j)
     1664                        for (size_t j = 0; j < uNumAttachments; ++j)
    16651665                        {
    16661666                            IMediumAttachment *pMediumAtt = atts[j];
    1667                             hrc = pMediumAtt->COMGETTER(Port)(&iPortNum);                   H();
     1667                            hrc = pMediumAtt->COMGETTER(Port)(&lPortNum);                   H();
    16681668                            if(SUCCEEDED(hrc))
    16691669                                hrc = pMediumAtt->COMGETTER(Type)(&lType);                    H();
     
    16711671                                {
    16721672                                    /* find min port number used for HD */
    1673                                     if(iPortNum < u32PortLUN[0])
    1674                                         u32PortLUN[0] = iPortNum;
    1675                                     u32PortUsed[u32HDSataPortCount++] = iPortNum;
     1673                                    if(lPortNum < lPortLUN[0])
     1674                                        lPortLUN[0] = lPortNum;
     1675                                    lPortUsed[u32HDSataPortCount++] = lPortNum;
    16761676                                    LogFlowFunc(("HD Sata port Count=%d\n", u32HDSataPortCount));
    16771677                                }
     
    16851685                            u32MaxPortCount = u32HDSataPortCount;
    16861686                        for (size_t i = 1; i < u32MaxPortCount; i++)
    1687                             u32PortLUN[i] = GetNextUsedSataPort(u32PortUsed,
    1688                                                                 u32PortLUN[i-1],
    1689                                                                 u32HDSataPortCount);
     1687                            lPortLUN[i] = GetNextUsedSataPort(lPortUsed,
     1688                                                              lPortLUN[i-1],
     1689                                                              u32HDSataPortCount);
    16901690                        if (pBiosCfg)
    1691                             for (j = 0; j < u32MaxPortCount; j++)
     1691                            for (size_t j = 0; j < u32MaxPortCount; j++)
    16921692                            {
    1693                                 InsertConfigInteger(pBiosCfg, s_apszBiosConfig[j], u32PortLUN[j]);
    1694                                 LogFlowFunc(("Top %d ports = %s, %d\n", j, s_apszBiosConfig[j], u32PortLUN[j]));
     1693                                InsertConfigInteger(pBiosCfg, s_apszBiosConfig[j], lPortLUN[j]);
     1694                                LogFlowFunc(("Top %d ports = %s, %d\n", j, s_apszBiosConfig[j], lPortLUN[j]));
    16951695                            }
    16961696                    }
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