VirtualBox

Changeset 107447 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 7, 2025 8:42:50 AM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166500
Message:

Main/src-server/ApplianceImplImport.cpp: Don't do the string -> uint64_t conversion multiple times (macro expands it multiple times), and use RT_CLAMP instead of nesting RT_MIN/RT_MAX to make the code easier to digest, bugref:3409

File:
1 edited

Legend:

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

    r107438 r107447  
    18361836                    {
    18371837                        vsdData = aVBoxValues[0];
    1838                         memoryInBytes = RT_MIN((uint64_t)(RT_MAX(vsdData.toUInt64(), (uint64_t)MM_RAM_MIN)), MM_RAM_MAX);
     1838
     1839                        uint64_t cbRam = vsdData.toUInt64();
     1840                        memoryInBytes = RT_CLAMP(cbRam, (uint64_t)MM_RAM_MIN, (uint64_t)MM_RAM_MAX);
    18391841                    }
    18401842                    //and set in ovf::VirtualSystem in bytes
Note: See TracChangeset for help on using the changeset viewer.

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