VirtualBox

Changeset 44091 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Dec 11, 2012 1:34:23 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
82613
Message:

Main: make the code more readable. Places where the comparisons were of the form 'isValid() == true\false' or 'isZero() == true\false' were carved \ simplified.

Location:
trunk/src/VBox/Main/src-server
Files:
4 edited

Legend:

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

    r44039 r44091  
    15381538{
    15391539#ifdef VBOX_WITH_USB
    1540     CheckComArgExpr(aId, Guid (aId).isValid() == true);
     1540    CheckComArgExpr(aId, Guid (aId).isValid());
    15411541    CheckComArgOutPointerValid(aDevice);
    15421542
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r44039 r44091  
    10011001    // never be found by findMachine()
    10021002    Guid test(aName);
    1003     //if (test.isNotEmpty())
     1003
    10041004    if (test.isValid())
    10051005        return setError(E_INVALIDARG,  tr("A machine cannot have a UUID as its name"));
  • trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp

    r44039 r44091  
    11311131                            {
    11321132                                strSrcTest = strSrcTest.substr(1, strSrcTest.length() - 2);
    1133                                 if (isValidGuid(strSrcTest))
     1133                               
     1134                                Guid temp_guid(strSrcTest);
     1135                                if (temp_guid.isValid() && !temp_guid.isZero())
    11341136                                    strNewName = Utf8StrFmt("%s%s", newId.toStringCurly().c_str(), RTPathExt(strNewName.c_str()));
    11351137                            }
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r44039 r44091  
    20612061                                    ComSafeArrayOut(BSTR, aSnapshotIds))
    20622062{
    2063     CheckComArgExpr(aMachineId, Guid(aMachineId).isValid() == true);
     2063    CheckComArgExpr(aMachineId, Guid(aMachineId).isValid());
    20642064    CheckComArgOutSafeArrayPointerValid(aSnapshotIds);
    20652065
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