VirtualBox

Changeset 5888 in vbox


Ignore:
Timestamp:
Nov 30, 2007 12:36:21 PM (17 years ago)
Author:
vboxsync
Message:

r=bird: 'b' == byte(s), no else after return, use AssertPtrReturn, memset instead of incomplete init, doxygen autobrief, space consistency.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp

    r5872 r5888  
    1616*******************************************************************************/
    1717#include <iprt/assert.h>
     18#include <iprt/string.h>
    1819
    1920#include <VBox/VBoxGuest.h>
     
    2122#include <VBox/log.h>
    2223
    23 #include <string.h>
    2424
    2525/* Move this to a header { */
     
    3333 *
    3434 * @returns IPRT status value
    35  * @param   bState whether or not we support seamless mode
     35 * @param   fState whether or not we support seamless mode
    3636 *
    3737 * @todo    Currently this will trample over any other capabilities the guest may have.
    3838 *          This will have to be fixed when more capabilities are added at the latest.
    3939 */
    40 VBGLR3DECL(int) VbglR3SeamlessSetCap(bool bState)
     40VBGLR3DECL(int) VbglR3SeamlessSetCap(bool fState)
    4141{
    42     VMMDevReqGuestCapabilities vmmreqGuestCaps = { {0} };
     42    VMMDevReqGuestCapabilities vmmreqGuestCaps;
    4343    int rc = VINF_SUCCESS;
    4444
     45    memset(&vmmreqGuestCaps, 0, sizeof(vmmreqGuestCaps));
    4546    vmmdevInitRequest(&vmmreqGuestCaps.header, VMMDevReq_ReportGuestCapabilities);
    46     vmmreqGuestCaps.caps = bState ? VMMDEV_GUEST_SUPPORTS_SEAMLESS : 0;
     47    vmmreqGuestCaps.caps = fState ? VMMDEV_GUEST_SUPPORTS_SEAMLESS : 0;
    4748    rc = VbglR3GRPerform(&vmmreqGuestCaps.header);
    4849#ifdef DEBUG
    4950    if (RT_SUCCESS(rc))
    50     {
    5151        LogRel(("Successfully enabled seamless mode on the host.\n"));
    52     }
    5352    else
    54     {
    55         LogRel(("Failed to enabled seamless mode on the host, rc = %Vrc.\n", rc));
    56     }
     53        LogRel(("Failed to enabled seamless mode on the host, rc = %Rrc.\n", rc));
    5754#endif
    5855    return rc;
     
    7168    int rc;
    7269
    73     AssertReturn(pMode != 0, VERR_INVALID_PARAMETER);
     70    AssertPtrReturn(pMode, VERR_INVALID_PARAMETER);
    7471    waitEvent.u32TimeoutIn = 0;
    7572    waitEvent.u32EventMaskIn = VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST;
     
    114111    int rc;
    115112
    116     rc = VbglR3GRAlloc ((VMMDevRequestHeader **)&req,
    117                       sizeof (VMMDevVideoSetVisibleRegion) + (cRects-1)*sizeof(RTRECT),
    118                       VMMDevReq_VideoSetVisibleRegion);
     113    rc = VbglR3GRAlloc((VMMDevRequestHeader **)&req,
     114                       sizeof(VMMDevVideoSetVisibleRegion) + (cRects - 1) * sizeof(RTRECT),
     115                       VMMDevReq_VideoSetVisibleRegion);
    119116    if (RT_SUCCESS(rc))
    120117    {
    121118        req->cRect = cRects;
    122         memcpy(&req->Rect, pRects, cRects*sizeof(RTRECT));
    123         rc = VbglR3GRPerform (&req->header);
     119        memcpy(&req->Rect, pRects, cRects * sizeof(RTRECT));
     120        rc = VbglR3GRPerform(&req->header);
    124121        VbglR3GRFree(&req->header);
    125122        if (RT_SUCCESS(rc))
    126123        {
    127124            if (RT_SUCCESS(req->header.rc))
    128             {
    129125                return VINF_SUCCESS;
    130             }
    131             else
    132                 rc = req->header.rc;
     126            rc = req->header.rc;
    133127        }
    134128    }
    135129    return rc;
    136130}
     131
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