VirtualBox

Changeset 69080 in vbox for trunk/src/VBox/Additions/x11


Ignore:
Timestamp:
Oct 13, 2017 3:40:38 PM (7 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: Replace custom VBVXASSERT with IPRT assertion syntax.
bugref:9017: Additions/x11: put vboxvideo into upstream X.Org

At some point we started using custom assertion code in X.Org vboxvideo.
This change removes that and switches assertions in the code to use IPRT
assertions, albeit provided by our IPRT replacement header and not by IPRT
itself.

Location:
trunk/src/VBox/Additions/x11/vboxvideo
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/getmode.c

    r69079 r69080  
    212212        return;
    213213    rc = VBoxHGSMIGetModeHints(&pVBox->guestCtx, pVBox->cScreens, pVBox->paVBVAModeHints);
    214     VBVXASSERT(rc == VINF_SUCCESS, ("VBoxHGSMIGetModeHints failed, rc=%d.\n", rc));
     214    AssertMsg(rc == VINF_SUCCESS, ("VBoxHGSMIGetModeHints failed, rc=%d.\n", rc));
    215215    for (i = 0; i < pVBox->cScreens; ++i)
    216216        if (pVBox->paVBVAModeHints[i].magic == VBVAMODEHINT_MAGIC)
     
    229229        }
    230230    rc = VBoxQueryConfHGSMI(&pVBox->guestCtx, VBOX_VBVA_CONF32_CURSOR_CAPABILITIES, &fCursorCapabilities);
    231     VBVXASSERT(rc == VINF_SUCCESS, ("Getting VBOX_VBVA_CONF32_CURSOR_CAPABILITIES failed, rc=%d.\n", rc));
     231    AssertMsg(rc == VINF_SUCCESS, ("Getting VBOX_VBVA_CONF32_CURSOR_CAPABILITIES failed, rc=%d.\n", rc));
    232232    compareAndMaybeSetUseHardwareCursor(pVBox, fCursorCapabilities, &fChanged, true);
    233233    if (pfNeedUpdate != NULL && fChanged)
     
    253253    while (rc > 0 || (rc == -1 && errno == EINTR));
    254254    /* Why do they return EAGAIN instead of zero bytes read like everyone else does? */
    255     VBVXASSERT(rc != -1 || errno == EAGAIN, ("Reading ACPI input event failed.\n"));
     255    AssertMsg(rc != -1 || errno == EAGAIN, ("Reading ACPI input event failed.\n"));
    256256}
    257257
  • trunk/src/VBox/Additions/x11/vboxvideo/pointer.c

    r69079 r69080  
    139139
    140140    rc = VBoxHGSMIUpdatePointerShape(&pVBox->guestCtx, 0, 0, 0, 0, 0, NULL, 0);
    141     VBVXASSERT(rc == VINF_SUCCESS, ("Could not hide the virtual mouse pointer, VBox error %d.\n", rc));
     141    AssertMsg(rc == VINF_SUCCESS, ("Could not hide the virtual mouse pointer, VBox error %d.\n", rc));
    142142}
    143143
     
    152152    rc = VBoxHGSMIUpdatePointerShape(&pVBox->guestCtx, VBOX_MOUSE_POINTER_VISIBLE,
    153153                                     0, 0, 0, 0, NULL, 0);
    154     VBVXASSERT(rc == VINF_SUCCESS, ("Could not unhide the virtual mouse pointer.\n"));
     154    AssertMsg(rc == VINF_SUCCESS, ("Could not unhide the virtual mouse pointer.\n"));
    155155}
    156156
     
    171171             pImage->cHotX, pImage->cHotY, pImage->cWidth, pImage->cHeight,
    172172             pImage->pPixels, pImage->cbLength);
    173     VBVXASSERT(rc == VINF_SUCCESS, ("Unable to set the virtual mouse pointer image.\n"));
     173    AssertMsg(rc == VINF_SUCCESS, ("Unable to set the virtual mouse pointer image.\n"));
    174174}
    175175
  • trunk/src/VBox/Additions/x11/vboxvideo/setmode.c

    r69065 r69080  
    6969
    7070    /* Assume 32BPP - this is just a sanity test. */
    71     VBVXASSERT(   cbOldSize / 4 <= VBOX_VIDEO_MAX_VIRTUAL * VBOX_VIDEO_MAX_VIRTUAL
     71    AssertMsg(   cbOldSize / 4 <= VBOX_VIDEO_MAX_VIRTUAL * VBOX_VIDEO_MAX_VIRTUAL
    7272               && cbNewSize / 4 <= VBOX_VIDEO_MAX_VIRTUAL * VBOX_VIDEO_MAX_VIRTUAL,
    7373               ("cbOldSize=%llu cbNewSize=%llu, max=%u.\n", (unsigned long long)cbOldSize, (unsigned long long)cbNewSize,
     
    9797              cDisplay, cWidth, cHeight, x, y, fEnabled, fConnected, pFrameBuffer->x0, pFrameBuffer->y0, pFrameBuffer->cWidth,
    9898              pFrameBuffer->cHeight, pFrameBuffer->cBPP);
    99     VBVXASSERT(cWidth != 0 && cHeight != 0, ("cWidth = 0 or cHeight = 0\n"));
     99    AssertMsg(cWidth != 0 && cHeight != 0, ("cWidth = 0 or cHeight = 0\n"));
    100100    offStart = (y * pFrameBuffer->cWidth + x) * pFrameBuffer->cBPP / 8;
    101101    if (cDisplay == 0 && fEnabled)
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r69079 r69080  
    245245
    246246    TRACE_LOG("width=%d, height=%d\n", width, height);
    247     VBVXASSERT(width >= 0 && height >= 0, ("Invalid negative width (%d) or height (%d)\n", width, height));
     247    AssertMsg(width >= 0 && height >= 0, ("Invalid negative width (%d) or height (%d)\n", width, height));
    248248    if (pScreen == NULL)  /* Not yet initialised. */
    249249        return TRUE;
    250250    pPixmap = pScreen->GetScreenPixmap(pScreen);
    251     VBVXASSERT(pPixmap != NULL, ("Failed to get the screen pixmap.\n"));
     251    AssertMsg(pPixmap != NULL, ("Failed to get the screen pixmap.\n"));
    252252    TRACE_LOG("pPixmap=%p adjustedWidth=%d height=%d pScrn->depth=%d pScrn->bitsPerPixel=%d cbLine=%d pVBox->base=%p pPixmap->drawable.width=%d pPixmap->drawable.height=%d\n",
    253253              (void *)pPixmap, adjustedWidth, height, pScrn->depth,
     
    343343     * See the work-around in ScreenInit. */
    344344    xf86RandR12GetOriginalVirtualSize(pScrn, &originalX, &originalY);
    345     VBVXASSERT(originalX == VBOX_VIDEO_MAX_VIRTUAL && originalY == VBOX_VIDEO_MAX_VIRTUAL, ("OriginalSize=%dx%d",
     345    AssertMsg(originalX == VBOX_VIDEO_MAX_VIRTUAL && originalY == VBOX_VIDEO_MAX_VIRTUAL, ("OriginalSize=%dx%d",
    346346               originalX, originalY));
    347347    for (i = cFirst; i < cLast; ++i)
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h

    r69079 r69080  
    7979
    8080#endif  /* !DEBUG */
    81 
    82 /* Not just for debug builds.  If something is wrong we want to know at once. */
    83 #define VBVXASSERT(expr, out) \
    84 if (!(expr)) \
    85 { \
    86     xf86ErrorF("\nAssertion failed!\n\n"); \
    87     xf86ErrorF("%s\n", #expr); \
    88     xf86ErrorF("at %s (%s:%d)\n", __func__, __FILE__, __LINE__); \
    89     xf86ErrorF out; \
    90     FatalError("Assertion"); \
    91 }
    9281
    9382#define VBOX_VERSION            VBOX_VERSION_MAJOR * 10000 \
  • trunk/src/VBox/Additions/x11/vboxvideo/vbva.c

    r69079 r69080  
    135135    rc = VBoxHGSMISetupGuestContext(&pVBox->guestCtx, pvGuestHeapMemory, cbGuestHeapMemory,
    136136                                    offVRAMBaseMapping + offGuestHeapMemory, &g_hgsmiEnv);
    137     VBVXASSERT(RT_SUCCESS(rc), ("Failed to set up the guest-to-host message buffer heap, rc=%d\n", rc));
     137    AssertMsg(RT_SUCCESS(rc), ("Failed to set up the guest-to-host message buffer heap, rc=%d\n", rc));
    138138    pVBox->cbView = offVRAMBaseMapping;
    139139}
     
    180180    rc = VBoxHGSMISendViewInfo(&pVBox->guestCtx, pVBox->cScreens,
    181181                               vboxFillViewInfo, (void *)pVBox);
    182     VBVXASSERT(RT_SUCCESS(rc), ("Failed to send the view information to the host, rc=%d\n", rc));
     182    AssertMsg(RT_SUCCESS(rc), ("Failed to send the view information to the host, rc=%d\n", rc));
    183183    return TRUE;
    184184}
     
    229229            rc = FALSE;
    230230    }
    231     VBVXASSERT(rc, ("Failed to enable screen update reporting for at least one virtual monitor.\n"));
     231    AssertMsg(rc, ("Failed to enable screen update reporting for at least one virtual monitor.\n"));
    232232    pVBox->fHaveHGSMIModeHints = haveHGSMIModeHintAndCursorReportingInterface(pVBox);
    233233    pVBox->fHostHasScreenBlankingFlag = hostHasScreenBlankingFlag(pVBox);
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