VirtualBox

Changeset 99608 in vbox for trunk


Ignore:
Timestamp:
May 4, 2023 2:19:43 PM (17 months ago)
Author:
vboxsync
Message:

fixed possible narrowing type from 'long unsigned int' to 'unsigned int'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r99606 r99608  
    18001800                }
    18011801
    1802                 uint64_t memory;
    1803                 pGuestOSType->COMGETTER(RecommendedRAM)(&memory);//returned in MB
    1804                 memory *= _1M;//convert to bytes
     1802                ULONG memoryInMB;
     1803                pGuestOSType->COMGETTER(RecommendedRAM)(&memoryInMB);//returned in MB
     1804                uint64_t memoryInBytes = memoryInMB * _1M;//convert to bytes
    18051805                {
    18061806                    /* It's alway stored in bytes in VSD according to the old internal agreement within the team */
     
    18091809                    {
    18101810                        vsdData = aVBoxValues[0];
    1811                         memory = RT_MIN((uint64_t)(RT_MAX(vsdData.toUInt64(), (uint64_t)MM_RAM_MIN)), MM_RAM_MAX);
     1811                        memoryInBytes = RT_MIN((uint64_t)(RT_MAX(vsdData.toUInt64(), (uint64_t)MM_RAM_MIN)), MM_RAM_MAX);
    18121812                    }
    18131813                    //and set in ovf::VirtualSystem in bytes
    1814                     vsys.ullMemorySize = memory;
     1814                    vsys.ullMemorySize = memoryInBytes;
    18151815                    LogRel(("%s: Size of RAM is %d MB\n", __FUNCTION__, vsys.ullMemorySize / _1M));
    18161816                }
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