VirtualBox

Changeset 63910 in vbox


Ignore:
Timestamp:
Sep 20, 2016 10:14:30 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110788
Message:

DevPlayground.cpp: Use the macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Samples/DevPlayground.cpp

    r63884 r63910  
    5454*   Device Functions                                                                                                             *
    5555*********************************************************************************************************************************/
    56 /**
    57  * @interface_method_impl{PDMDEVREG,pfnDestruct}
    58  */
    59 static DECLCALLBACK(int) devPlaygroundDestruct(PPDMDEVINS pDevIns)
    60 {
    61     /*
    62      * Check the versions here as well since the destructor is *always* called.
    63      */
    64     AssertMsgReturn(pDevIns->u32Version            == PDM_DEVINS_VERSION, ("%#x, expected %#x\n", pDevIns->u32Version,            PDM_DEVINS_VERSION), VERR_VERSION_MISMATCH);
    65     AssertMsgReturn(pDevIns->pHlpR3->u32Version == PDM_DEVHLPR3_VERSION, ("%#x, expected %#x\n", pDevIns->pHlpR3->u32Version, PDM_DEVHLPR3_VERSION), VERR_VERSION_MISMATCH);
    66 
    67     return VINF_SUCCESS;
    68 }
    69 
    7056
    7157PDMBOTHCBDECL(int) devPlaygroundMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
     
    122108
    123109/**
     110 * @interface_method_impl{PDMDEVREG,pfnDestruct}
     111 */
     112static DECLCALLBACK(int) devPlaygroundDestruct(PPDMDEVINS pDevIns)
     113{
     114    /*
     115     * Check the versions here as well since the destructor is *always* called.
     116     */
     117    PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns);
     118
     119    return VINF_SUCCESS;
     120}
     121
     122
     123/**
    124124 * @interface_method_impl{PDMDEVREG,pfnConstruct}
    125125 */
    126126static DECLCALLBACK(int) devPlaygroundConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
    127127{
    128     NOREF(iInstance);
     128    RT_NOREF(iInstance, pCfg);
    129129
    130130    /*
    131131     * Check that the device instance and device helper structures are compatible.
    132132     */
    133     AssertLogRelMsgReturn(pDevIns->u32Version            == PDM_DEVINS_VERSION, ("%#x, expected %#x\n", pDevIns->u32Version,            PDM_DEVINS_VERSION), VERR_VERSION_MISMATCH);
    134     AssertLogRelMsgReturn(pDevIns->pHlpR3->u32Version == PDM_DEVHLPR3_VERSION, ("%#x, expected %#x\n", pDevIns->pHlpR3->u32Version, PDM_DEVHLPR3_VERSION), VERR_VERSION_MISMATCH);
     133    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    135134
    136135    /*
     
    146145     * Validate and read the configuration.
    147146     */
    148     if (!CFGMR3AreValuesValid(pCfg,
    149                               "Whatever1\0"
    150                               "Whatever2\0"))
    151         return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
     147    PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Whatever1|Whatever2", "");
    152148
    153149    /*
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