VirtualBox

Ignore:
Timestamp:
Jul 30, 2009 12:42:08 PM (15 years ago)
Author:
vboxsync
Message:

Main: coding style: have Main obey the standard VirtualBox coding style rules (no functional changes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/SharedFolderImpl.cpp

    r21079 r21878  
    7070{
    7171    /* Enclose the state transition NotReady->InInit->Ready */
    72     AutoInitSpan autoInitSpan (this);
    73     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    74 
    75     unconst (mMachine) = aMachine;
     72    AutoInitSpan autoInitSpan(this);
     73    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     74
     75    unconst(mMachine) = aMachine;
    7676
    7777    HRESULT rc = protectedInit (aMachine, aName, aHostPath, aWritable);
    7878
    7979    /* Confirm a successful initialization when it's the case */
    80     if (SUCCEEDED (rc))
     80    if (SUCCEEDED(rc))
    8181        autoInitSpan.setSucceeded();
    8282
     
    9999
    100100    /* Enclose the state transition NotReady->InInit->Ready */
    101     AutoInitSpan autoInitSpan (this);
    102     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    103 
    104     unconst (mMachine) = aMachine;
     101    AutoInitSpan autoInitSpan(this);
     102    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     103
     104    unconst(mMachine) = aMachine;
    105105
    106106    HRESULT rc = protectedInit (aMachine, aThat->m.name,
     
    108108
    109109    /* Confirm a successful initialization when it's the case */
    110     if (SUCCEEDED (rc))
     110    if (SUCCEEDED(rc))
    111111        autoInitSpan.setSucceeded();
    112112
     
    128128{
    129129    /* Enclose the state transition NotReady->InInit->Ready */
    130     AutoInitSpan autoInitSpan (this);
    131     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    132 
    133     unconst (mConsole) = aConsole;
     130    AutoInitSpan autoInitSpan(this);
     131    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     132
     133    unconst(mConsole) = aConsole;
    134134
    135135    HRESULT rc = protectedInit (aConsole, aName, aHostPath, aWritable);
    136136
    137137    /* Confirm a successful initialization when it's the case */
    138     if (SUCCEEDED (rc))
     138    if (SUCCEEDED(rc))
    139139        autoInitSpan.setSucceeded();
    140140
     
    156156{
    157157    /* Enclose the state transition NotReady->InInit->Ready */
    158     AutoInitSpan autoInitSpan (this);
    159     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    160 
    161     unconst (mVirtualBox) = aVirtualBox;
     158    AutoInitSpan autoInitSpan(this);
     159    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     160
     161    unconst(mVirtualBox) = aVirtualBox;
    162162
    163163    HRESULT rc = protectedInit (aVirtualBox, aName, aHostPath, aWritable);
    164164
    165165    /* Confirm a successful initialization when it's the case */
    166     if (SUCCEEDED (rc))
     166    if (SUCCEEDED(rc))
    167167        autoInitSpan.setSucceeded();
    168168
     
    179179                                     CBSTR aName, CBSTR aHostPath, BOOL aWritable)
    180180{
    181     LogFlowThisFunc (("aName={%ls}, aHostPath={%ls}, aWritable={%d}\n",
     181    LogFlowThisFunc(("aName={%ls}, aHostPath={%ls}, aWritable={%d}\n",
    182182                      aName, aHostPath, aWritable));
    183183
     
    209209    int vrc = RTPathAbsEx (NULL, hostPath,
    210210                           hostPathFull, sizeof (hostPathFull));
    211     if (RT_FAILURE (vrc))
     211    if (RT_FAILURE(vrc))
    212212        return setError (E_INVALIDARG,
    213213            tr ("Invalid shared folder path: '%s' (%Rrc)"), hostPath.raw(), vrc);
     
    217217            tr ("Shared folder path '%s' is not absolute"), hostPath.raw());
    218218
    219     unconst (mParent) = aParent;
     219    unconst(mParent) = aParent;
    220220
    221221    /* register with parent */
    222222    mParent->addDependentChild (this);
    223223
    224     unconst (m.name) = aName;
    225     unconst (m.hostPath) = hostPath;
     224    unconst(m.name) = aName;
     225    unconst(m.hostPath) = hostPath;
    226226    m.writable = aWritable;
    227227
     
    235235void SharedFolder::uninit()
    236236{
    237     LogFlowThisFunc (("\n"));
     237    LogFlowThisFunc(("\n"));
    238238
    239239    /* Enclose the state transition Ready->InUninit->NotReady */
    240     AutoUninitSpan autoUninitSpan (this);
     240    AutoUninitSpan autoUninitSpan(this);
    241241    if (autoUninitSpan.uninitDone())
    242242        return;
     
    245245        mParent->removeDependentChild (this);
    246246
    247     unconst (mParent) = NULL;
    248 
    249     unconst (mMachine).setNull();
    250     unconst (mConsole).setNull();
    251     unconst (mVirtualBox).setNull();
     247    unconst(mParent) = NULL;
     248
     249    unconst(mMachine).setNull();
     250    unconst(mConsole).setNull();
     251    unconst(mVirtualBox).setNull();
    252252}
    253253
     
    259259    CheckComArgOutPointerValid(aName);
    260260
    261     AutoCaller autoCaller (this);
    262     CheckComRCReturnRC (autoCaller.rc());
     261    AutoCaller autoCaller(this);
     262    CheckComRCReturnRC(autoCaller.rc());
    263263
    264264    /* mName is constant during life time, no need to lock */
    265     m.name.cloneTo (aName);
     265    m.name.cloneTo(aName);
    266266
    267267    return S_OK;
     
    272272    CheckComArgOutPointerValid(aHostPath);
    273273
    274     AutoCaller autoCaller (this);
    275     CheckComRCReturnRC (autoCaller.rc());
     274    AutoCaller autoCaller(this);
     275    CheckComRCReturnRC(autoCaller.rc());
    276276
    277277    /* mHostPath is constant during life time, no need to lock */
    278     m.hostPath.cloneTo (aHostPath);
     278    m.hostPath.cloneTo(aHostPath);
    279279
    280280    return S_OK;
     
    283283STDMETHODIMP SharedFolder::COMGETTER(Accessible) (BOOL *aAccessible)
    284284{
    285     CheckComArgOutPointerValid (aAccessible);
    286 
    287     AutoCaller autoCaller (this);
    288     CheckComRCReturnRC (autoCaller.rc());
     285    CheckComArgOutPointerValid(aAccessible);
     286
     287    AutoCaller autoCaller(this);
     288    CheckComRCReturnRC(autoCaller.rc());
    289289
    290290    /* mName and mHostPath are constant during life time, no need to lock */
     
    296296                                                    sizeof (hostPathFull))
    297297                                      : VERR_PATH_NOT_FOUND;
    298     if (RT_SUCCESS (vrc))
     298    if (RT_SUCCESS(vrc))
    299299    {
    300300        *aAccessible = TRUE;
     
    302302    }
    303303
    304     AutoWriteLock alock (this);
     304    AutoWriteLock alock(this);
    305305
    306306    m.lastAccessError = BstrFmt (
    307307        tr ("'%s' is not accessible (%Rrc)"), hostPath.raw(), vrc);
    308308
    309     LogWarningThisFunc (("m.lastAccessError=\"%ls\"\n", m.lastAccessError.raw()));
     309    LogWarningThisFunc(("m.lastAccessError=\"%ls\"\n", m.lastAccessError.raw()));
    310310
    311311    *aAccessible = FALSE;
     
    324324STDMETHODIMP SharedFolder::COMGETTER(LastAccessError) (BSTR *aLastAccessError)
    325325{
    326     CheckComArgOutPointerValid (aLastAccessError);
    327 
    328     AutoCaller autoCaller (this);
    329     CheckComRCReturnRC (autoCaller.rc());
    330 
    331     AutoReadLock alock (this);
     326    CheckComArgOutPointerValid(aLastAccessError);
     327
     328    AutoCaller autoCaller(this);
     329    CheckComRCReturnRC(autoCaller.rc());
     330
     331    AutoReadLock alock(this);
    332332
    333333    if (m.lastAccessError.isEmpty())
    334334        Bstr("").cloneTo(aLastAccessError);
    335335    else
    336         m.lastAccessError.cloneTo (aLastAccessError);
     336        m.lastAccessError.cloneTo(aLastAccessError);
    337337
    338338    return S_OK;
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