VirtualBox

Ignore:
Timestamp:
Feb 28, 2008 6:43:08 PM (17 years ago)
Author:
vboxsync
Message:

Main: Reworked enums to avoid 1) weird duplication of enum name when referring to enum values in cross-platform code; 2) possible clashes on Win32 due to putting identifiers like Paused or Disabled to the global namespace (via C enums). In the new style, enums are used like this: a) USBDeviceState_T v = USBDeviceState_Busy from cross-platform non-Qt code; b) KUSBDeviceState v = KUSBDeviceState_Busy from Qt code; c) USBDeviceState v = USBDeviceState_Busy from plain Win32 and d) PRUInt32 USBDeviceState v = USBDeviceState::Busy from plain XPCOM.

File:
1 edited

Legend:

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

    r6895 r7207  
    189189        : VMProgressTask (aConsole, aProgress, true /* aUsesVMPtr */)
    190190        , mIsSnapshot (false)
    191         , mLastMachineState (MachineState_InvalidMachineState) {}
     191        , mLastMachineState (MachineState_Null) {}
    192192
    193193    bool mIsSnapshot;
     
    477477    AssertComRCReturn (hrc, VERR_ACCESS_DENIED);
    478478
    479     VRDPAuthType_T authType = VRDPAuthType_VRDPAuthNull;
     479    VRDPAuthType_T authType = VRDPAuthType_Null;
    480480    hrc = mVRDPServer->COMGETTER(AuthType) (&authType);
    481481    AssertComRCReturn (hrc, VERR_ACCESS_DENIED);
     
    492492    LogRel (("VRDPAUTH: User: [%s]. Domain: [%s]. Authentication type: [%s]\n",
    493493                pszUser, pszDomain,
    494                 authType == VRDPAuthType_VRDPAuthNull?
     494                authType == VRDPAuthType_Null?
    495495                    "null":
    496                     (authType == VRDPAuthType_VRDPAuthExternal?
     496                    (authType == VRDPAuthType_External?
    497497                        "external":
    498                         (authType == VRDPAuthType_VRDPAuthGuest?
     498                        (authType == VRDPAuthType_Guest?
    499499                            "guest":
    500500                            "INVALID"
     
    526526    switch (authType)
    527527    {
    528         case VRDPAuthType_VRDPAuthNull:
     528        case VRDPAuthType_Null:
    529529        {
    530530            result = VRDPAuthAccessGranted;
     
    532532        }
    533533
    534         case VRDPAuthType_VRDPAuthExternal:
     534        case VRDPAuthType_External:
    535535        {
    536536            /* Call the external library. */
     
    547547        } /* pass through */
    548548
    549         case VRDPAuthType_VRDPAuthGuest:
     549        case VRDPAuthType_Guest:
    550550        {
    551551            guestJudgement = VRDPAuthGuestNotReacted;
     
    590590            }
    591591
    592             if (authType == VRDPAuthType_VRDPAuthExternal)
     592            if (authType == VRDPAuthType_External)
    593593            {
    594594                LogRel(("VRDPAUTH: Guest judgement %d.\n", guestJudgement));
     
    709709    AssertComRC (hrc);
    710710
    711     VRDPAuthType_T authType = VRDPAuthType_VRDPAuthNull;
     711    VRDPAuthType_T authType = VRDPAuthType_Null;
    712712    hrc = mVRDPServer->COMGETTER(AuthType) (&authType);
    713713    AssertComRC (hrc);
    714714
    715     if (authType == VRDPAuthType_VRDPAuthExternal)
     715    if (authType == VRDPAuthType_External)
    716716        mConsoleVRDPServer->AuthDisconnect (uuid, u32ClientId);
    717717
     
    12661266        switch (netattach)
    12671267        {
    1268             case NetworkAttachmentType_HostInterfaceNetworkAttachment:
     1268            case NetworkAttachmentType_HostInterface:
    12691269            {
    12701270#ifdef RT_OS_WINDOWS
     
    18531853    switch (aDeviceType)
    18541854    {
    1855         case DeviceType_FloppyDevice:
     1855        case DeviceType_Floppy:
    18561856        {
    18571857            for (unsigned i = 0; i < ELEMENTS(mapFDLeds); i++)
     
    18601860        }
    18611861
    1862         case DeviceType_DVDDevice:
     1862        case DeviceType_DVD:
    18631863        {
    18641864            SumLed.u32 |= readAndClearLed(mapIDELeds[2]);
     
    18661866        }
    18671867
    1868         case DeviceType_HardDiskDevice:
     1868        case DeviceType_HardDisk:
    18691869        {
    18701870            SumLed.u32 |= readAndClearLed(mapIDELeds[0]);
     
    18741874        }
    18751875
    1876         case DeviceType_NetworkDevice:
     1876        case DeviceType_Network:
    18771877        {
    18781878            for (unsigned i = 0; i < ELEMENTS(mapNetworkLeds); i++)
     
    18811881        }
    18821882
    1883         case DeviceType_USBDevice:
     1883        case DeviceType_USB:
    18841884        {
    18851885            SumLed.u32 |= readAndClearLed(mapUSBLed);
     
    18871887        }
    18881888
    1889         case DeviceType_SharedFolderDevice:
     1889        case DeviceType_SharedFolder:
    18901890        {
    18911891            SumLed.u32 |= readAndClearLed(mapSharedFolderLed);
     
    19021902    {
    19031903        case 0:
    1904             *aDeviceActivity = DeviceActivity_DeviceIdle;
     1904            *aDeviceActivity = DeviceActivity_Idle;
    19051905            break;
    19061906        case PDMLED_READING:
    1907             *aDeviceActivity = DeviceActivity_DeviceReading;
     1907            *aDeviceActivity = DeviceActivity_Reading;
    19081908            break;
    19091909        case PDMLED_WRITING:
    19101910        case PDMLED_READING | PDMLED_WRITING:
    1911             *aDeviceActivity = DeviceActivity_DeviceWriting;
     1911            *aDeviceActivity = DeviceActivity_Writing;
    19121912            break;
    19131913    }
     
    21112111        CallbackList::iterator it = mCallbacks.begin();
    21122112        while (it != mCallbacks.end())
    2113             (*it++)->OnSharedFolderChange (Scope_SessionScope);
     2113            (*it++)->OnSharedFolderChange (Scope_Session);
    21142114    }
    21152115
     
    21702170        CallbackList::iterator it = mCallbacks.begin();
    21712171        while (it != mCallbacks.end())
    2172             (*it++)->OnSharedFolderChange (Scope_SessionScope);
     2172            (*it++)->OnSharedFolderChange (Scope_Session);
    21732173    }
    21742174
     
    23692369            mMachineState);
    23702370
    2371     MachineState_T machineState = MachineState_InvalidMachineState;
     2371    MachineState_T machineState = MachineState_Null;
    23722372    HRESULT rc = mControl->DiscardSnapshot (this, aId, &machineState, aProgress);
    23732373    CheckComRCReturnRC (rc);
     
    23902390            mMachineState);
    23912391
    2392     MachineState_T machineState = MachineState_InvalidMachineState;
     2392    MachineState_T machineState = MachineState_Null;
    23932393    HRESULT rc = mControl->DiscardCurrentState (this, &machineState, aProgress);
    23942394    CheckComRCReturnRC (rc);
     
    24112411            mMachineState);
    24122412
    2413     MachineState_T machineState = MachineState_InvalidMachineState;
     2413    MachineState_T machineState = MachineState_Null;
    24142414    HRESULT rc =
    24152415        mControl->DiscardCurrentSnapshotAndState (this, &machineState, aProgress);
     
    33503350        CallbackList::iterator it = mCallbacks.begin();
    33513351        while (it != mCallbacks.end())
    3352             (*it++)->OnSharedFolderChange (aGlobal ? (Scope_T)Scope_GlobalScope
    3353                                                    : (Scope_T)Scope_MachineScope);
     3352            (*it++)->OnSharedFolderChange (aGlobal ? (Scope_T) Scope_Global
     3353                                                   : (Scope_T) Scope_Machine);
    33543354    }
    33553355
     
    42444244             *  can lead to various unexpected results (like the machine state being
    42454245             *  >= MachineState_Running on the server, while the session state is
    4246              *  already SessionState_SessionClosed at the same time there).
     4246             *  already SessionState_Closed at the same time there).
    42474247             *
    42484248             *  Cross-lock conditions should be carefully watched out: calling
     
    51405140    NetworkAttachmentType_T attachment;
    51415141    networkAdapter->COMGETTER(AttachmentType)(&attachment);
    5142     Assert(attachment == NetworkAttachmentType_HostInterfaceNetworkAttachment);
     5142    Assert(attachment == NetworkAttachmentType_HostInterface);
    51435143#endif /* DEBUG */
    51445144
     
    53395339    NetworkAttachmentType_T attachment;
    53405340    networkAdapter->COMGETTER(AttachmentType)(&attachment);
    5341     Assert(attachment == NetworkAttachmentType_HostInterfaceNetworkAttachment);
     5341    Assert(attachment == NetworkAttachmentType_HostInterface);
    53425342#endif /* DEBUG */
    53435343
     
    54495449        NetworkAttachmentType_T attachment;
    54505450        networkAdapter->COMGETTER(AttachmentType)(&attachment);
    5451         if (attachment == NetworkAttachmentType_HostInterfaceNetworkAttachment)
     5451        if (attachment == NetworkAttachmentType_HostInterface)
    54525452        {
    54535453            HRESULT rc2 = detachFromHostInterface(networkAdapter);
     
    61276127    switch (enmCtl)
    61286128    {
    6129         case DiskControllerType_IDE0Controller:
     6129        case DiskControllerType_IDE0:
    61306130            i = 0;
    61316131            break;
    6132         case DiskControllerType_IDE1Controller:
     6132        case DiskControllerType_IDE1:
    61336133            i = 2;
    61346134            break;
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