VirtualBox

Changeset 78095 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 10, 2019 3:23:03 PM (6 years ago)
Author:
vboxsync
Message:

DnD/Main: Added validation mask for the DND_OBJCTX_STATE_ flags, docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r78093 r78095  
    369369};
    370370
    371 /** Initial state. */
     371/** Initial object context state / no state set. */
    372372#define DND_OBJCTX_STATE_NONE           0
    373 /** The header was received/sent. */
     373/** The header was received / sent. */
    374374#define DND_OBJCTX_STATE_HAS_HDR        RT_BIT(0)
     375/** Validation mask for object context state. */
     376#define DND_OBJCTX_STATE_VALID_MASK     UINT32_C(0x00000001)
    375377
    376378/**
     
    435437    bool isValid(void) const { return (pObjURI != NULL); }
    436438
     439    /** Returns the current state. */
    437440    uint32_t getState(void) const { return fState; }
    438441
     
    444447
    445448        fIntermediate = false;
    446         fState        = 0;
     449        fState        = DND_OBJCTX_STATE_NONE;
    447450    }
    448451
     
    456459    }
    457460
     461    /**
     462     * Sets the new state.
     463     *
     464     * @returns The new state, if set.
     465     * @param   fStateNew       New state to set.
     466     */
    458467    uint32_t setState(uint32_t fStateNew)
    459468    {
    460         /** @todo Add validation. */
     469        AssertReturn(!(fStateNew & ~DND_OBJCTX_STATE_VALID_MASK), fState /* Return old state */);
    461470        fState = fStateNew;
    462471        return fState;
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