VirtualBox

Changeset 8565

Show
Ignore:
Timestamp:
05/05/08 14:01:52 (8 months ago)
Author:
vboxsync
Message:

AssertMsgBreak? -> AssertMsgBreakStmt?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/iprt/assert.h

    r8563 r8565  
    415415 
    416416 
    417 /** @def AssertMsgBreak 
     417/** @def AssertMsgBreakStmt 
    418418 * Assert that an expression is true and breaks if it isn't. 
    419419 * In RT_STRICT mode it will hit a breakpoint before doing break. 
     
    422422 * @param   a       printf argument list (in parenthesis). 
    423423 * @param   stmt    Statement to execute before break in case of a failed assertion. 
    424  * @todo Rename to AssertMsgBreakStmt. 
    425  */ 
    426 #ifdef RT_STRICT 
    427 # define AssertMsgBreak(expr, a, stmt) \ 
     424 */ 
     425#ifdef RT_STRICT 
     426# define AssertMsgBreakStmt(expr, a, stmt) \ 
    428427    if (RT_UNLIKELY(!(expr))) { \ 
    429428        AssertMsg1(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \ 
     
    434433    } else do {} while (0) 
    435434#else 
    436 # define AssertMsgBreak(expr, a, stmt) \ 
     435# define AssertMsgBreakStmt(expr, a, stmt) \ 
    437436    if (RT_UNLIKELY(!(expr))) { \ 
    438437        stmt; \ 
     
    14991498 */ 
    15001499#define AssertMsgRCBreak(rc, msg, stmt) \ 
    1501     do { AssertMsgBreak(RT_SUCCESS_NP(rc), msg, stmt); NOREF(rc); } while (0) 
     1500    do { AssertMsgBreakStmt(RT_SUCCESS_NP(rc), msg, stmt); NOREF(rc); } while (0) 
    15021501 
    15031502/** @def AssertMsgRCBreakVoid 
     
    15491548 * @todo Rename to AssertRCSuccessBreakStmt. 
    15501549 */ 
    1551 #define AssertRCSuccessBreak(rc, stmt)    AssertMsgBreak((rc) == VINF_SUCCESS, ("%Vra\n", (rc)), stmt) 
     1550#define AssertRCSuccessBreak(rc, stmt)    AssertMsgBreakStmt((rc) == VINF_SUCCESS, ("%Vra\n", (rc)), stmt) 
    15521551 
    15531552/** @def AssertRCSuccessBreakVoid 
     
    19341933 * @todo Rename to AssertPtrBreakStmt. 
    19351934 */ 
    1936 #define AssertPtrBreak(pv, stmt)  AssertMsgBreak(VALID_PTR(pv), ("%p\n", (pv)), stmt) 
     1935#define AssertPtrBreak(pv, stmt)  AssertMsgBreakStmt(VALID_PTR(pv), ("%p\n", (pv)), stmt) 
    19371936 
    19381937/** @def AssertPtrBreakVoid 
     
    19731972 * @todo Rename to AssertPtrNullBreakStmt. 
    19741973 */ 
    1975 #define AssertPtrNullBreak(pv, stmt)  AssertMsgBreak(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)), stmt) 
     1974#define AssertPtrNullBreak(pv, stmt)  AssertMsgBreakStmt(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)), stmt) 
    19761975 
    19771976/** @def AssertPtrNullBreakVoid 
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp

    r8155 r8565  
    6666*******************************************************************************/ 
    6767 
    68 /** The control thread (main) handle.  
     68/** The control thread (main) handle. 
    6969 * Only used to avoid some queue creation trouble. */ 
    7070static RTTHREAD g_ThreadCtrl = NIL_RTTHREAD; 
     
    9191/** The timer id returned by WinStartTimer. */ 
    9292static ULONG g_idWorkerTimer = ~0UL; 
    93 /** The state of the clipboard.  
     93/** The state of the clipboard. 
    9494 * @remark I'm trying out the 'k' prefix from the mac here, bear with me.  */ 
    9595static enum 
    96 {  
     96{ 
    9797    /** The clipboard hasn't been initialized yet. */ 
    9898    kClipboardState_Uninitialized = 0, 
     
    101101    /** We're monitoring the clipboard as a viewer. */ 
    102102    kClipboardState_Viewer, 
    103     /** We're monitoring the clipboard using polling.  
     103    /** We're monitoring the clipboard using polling. 
    104104     * This usually means something is wrong... */ 
    105105    kClipboardState_Polling, 
     
    112112static bool g_fEmptyClipboard = false; 
    113113 
    114 /** A clipboard format atom for the dummy clipboard data we insert  
    115  * watching for clipboard changes. If this format is found on the  
    116  * clipboard, the empty clipboard function has not been called  
     114/** A clipboard format atom for the dummy clipboard data we insert 
     115 * watching for clipboard changes. If this format is found on the 
     116 * clipboard, the empty clipboard function has not been called 
    117117 * since we last polled it. */ 
    118118static ATOM g_atomNothingChanged = 0; 
     
    157157 
    158158    /* 
    159      * Since we have to send shutdown messages and such from the  
     159     * Since we have to send shutdown messages and such from the 
    160160     * service controller (main) thread, create a HAB and HMQ for it. 
    161161     */ 
     
    193193                    g_atomOdin32UnicodeText = WinFindAtom(WinQuerySystemAtomTable(), SZFMT_ODIN32_UNICODETEXT); 
    194194                if (g_atomOdin32UnicodeText == 0) 
    195                     VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n",  
     195                    VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n", 
    196196                                     lLastError, WinGetLastError(g_habCtrl)); 
    197197 
    198                 VBoxServiceVerbose(2, "g_u32ClientId=%RX32 g_atomNothingChanged=%#x g_atomOdin32UnicodeText=%#x\n",  
     198                VBoxServiceVerbose(2, "g_u32ClientId=%RX32 g_atomNothingChanged=%#x g_atomOdin32UnicodeText=%#x\n", 
    199199                                   g_u32ClientId, g_atomNothingChanged, g_atomOdin32UnicodeText); 
    200200                return VINF_SUCCESS; 
     
    204204        } 
    205205        else 
    206             VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n",  
     206            VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n", 
    207207                             lLastError, WinGetLastError(g_habCtrl)); 
    208208    } 
     
    237237        g_enmState = kClipboardState_Polling; 
    238238    if ((int)g_enmState != iOrgState) 
    239     {  
     239    { 
    240240        if (g_enmState == kClipboardState_Viewer) 
    241241            VBoxServiceVerbose(3, "clipboard: viewer\n"); 
     
    253253    /* 
    254254     * Open the clipboard and switch to 'destruction' mode. 
    255      * Make sure we stop being viewer. Temporarily also make sure we're  
     255     * Make sure we stop being viewer. Temporarily also make sure we're 
    256256     * not the owner so that PM won't send us any WM_DESTROYCLIPBOARD message. 
    257257     */ 
     
    259259    { 
    260260        if (g_enmState == kClipboardState_Viewer) 
    261             WinSetClipbrdViewer(g_habWorker, NULLHANDLE);  
     261            WinSetClipbrdViewer(g_habWorker, NULLHANDLE); 
    262262        if (g_enmState == kClipboardState_Owner) 
    263             WinSetClipbrdOwner(g_habWorker, NULLHANDLE);  
     263            WinSetClipbrdOwner(g_habWorker, NULLHANDLE); 
    264264 
    265265        g_enmState = kClipboardState_Destroying; 
     
    343343 
    344344    /* 
    345      * The Odin32 stuff is simple, we just assume windows data from the host  
     345     * The Odin32 stuff is simple, we just assume windows data from the host 
    346346     * and all we need to do is add the header. 
    347347     */ 
    348     if (    usFmt  
     348    if (    usFmt 
    349349        &&  (   usFmt == g_atomOdin32UnicodeText 
    350350             /* || usFmt == ...*/ 
     
    358358         * 
    359359         * Note that we probably should be using the current PM or DOS codepage 
    360          * here instead of the LC_CTYPE one which iconv uses by default.  
     360         * here instead of the LC_CTYPE one which iconv uses by default. 
    361361         * -lazybird 
    362362         */ 
     
    388388            VBoxServiceError("RTUtf16ToUtf8() -> %Rrc\n", rc); 
    389389    } 
    390      
     390 
    391391    return pvPM; 
    392392} 
     
    395395/** 
    396396 * Tries to deliver an advertised host format. 
    397  *  
     397 * 
    398398 * @param   usFmt       The PM format name. 
    399  *  
    400  * @remark  We must not try open the clipboard here because WM_RENDERFMT is a  
    401  *          request send synchronously by someone who has already opened the  
     399 * 
     400 * @remark  We must not try open the clipboard here because WM_RENDERFMT is a 
     401 *          request send synchronously by someone who has already opened the 
    402402 *          clipboard. We would enter a deadlock trying to open it here. 
    403  *           
     403 * 
    404404 */ 
    405405static void VBoxServiceClipboardOS2RenderFormat(USHORT usFmt) 
     
    413413    if (    usFmt == CF_TEXT 
    414414        ||  usFmt == g_atomOdin32UnicodeText) 
    415         fFormat = VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT;  
     415        fFormat = VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; 
    416416    else /** @todo bitmaps */ 
    417417        fFormat = 0; 
    418418    if (fFormat) 
    419419    { 
    420         /*  
     420        /* 
    421421         * Query the data from the host. 
    422422         * This might require two iterations because of buffer guessing. 
     
    492492            PVOID pvPM; 
    493493            PCLIPHEADER pHdr = (PCLIPHEADER)WinQueryClipbrdData(g_habWorker, g_atomOdin32UnicodeText); 
    494             if (    pHdr  
     494            if (    pHdr 
    495495                &&  !memcmp(pHdr->achMagic, CLIPHEADER_MAGIC, sizeof(pHdr->achMagic))) 
    496496            { 
     
    548548    while ((ulFormat = WinEnumClipbrdFmts(g_habWorker, ulFormat)) != 0) 
    549549    { 
    550         if (    ulFormat == CF_TEXT  
     550        if (    ulFormat == CF_TEXT 
    551551            ||  ulFormat == g_atomOdin32UnicodeText) 
    552552            fFormats |= VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; 
     
    560560/** 
    561561 * Poll the clipboard for changes. 
    562  *  
    563  * This is called both when we're the viewer and when we're  
     562 * 
     563 * This is called both when we're the viewer and when we're 
    564564 * falling back to polling. If something has changed it will 
    565565 * notify the host. 
     
    580580                g_fEmptyClipboard = false; 
    581581                VBoxServiceClipboardOS2ReportFormats(); 
    582      
     582 
    583583                /* inject the dummy */ 
    584584                PVOID pv; 
     
    632632/** 
    633633 * The window procedure for the object window. 
    634  *  
     634 * 
    635635 * @returns Message result. 
    636  *  
     636 * 
    637637 * @param   hwnd    The window handle. 
    638638 * @param   msg     The message. 
     
    665665            break; 
    666666 
    667         /*  
     667        /* 
    668668         * Clipboard viewer message - the content has been changed. 
    669          * This is sent *after* releasing the clipboard sem  
     669         * This is sent *after* releasing the clipboard sem 
    670670         * and during the WinSetClipbrdViewer call. 
    671671         */ 
     
    673673            if (g_enmState == kClipboardState_SettingViewer) 
    674674                break; 
    675             AssertMsgBreak(g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState), ); 
     675            AssertMsgBreakVoid(g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState)); 
    676676            VBoxServiceClipboardOS2Poll(); 
    677677            break; 
    678678 
    679         /*  
     679        /* 
    680680         * Clipboard owner message - the content was replaced. 
    681681         * This is sent by someone with an open clipboard, so don't try open it now. 
     
    684684            if (g_enmState == kClipboardState_Destroying) 
    685685                break; /* it's us doing the replacing, ignore. */ 
    686             AssertMsgBreak(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState), ); 
     686            AssertMsgBreakVoid(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState)); 
    687687            VBoxServiceClipboardOS2Destroyed(); 
    688688            break; 
     
    693693         */ 
    694694        case WM_RENDERFMT: 
    695             AssertMsgBreak(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState), ); 
     695            AssertMsgBreakVoid(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState)); 
    696696            VBoxServiceClipboardOS2RenderFormat(SHORT1FROMMP(mp1)); 
    697697            break; 
    698698 
    699699        /* 
    700          * Clipboard owner message - we're about to quit and should render all formats.  
     700         * Clipboard owner message - we're about to quit and should render all formats. 
    701701         * 
    702          * However, because we're lazy, we'll just ASSUME that since we're quitting  
    703          * we're probably about to shutdown or something and there is no point in  
    704          * doing anything here except for emptying the clipboard and removing  
     702         * However, because we're lazy, we'll just ASSUME that since we're quitting 
     703         * we're probably about to shutdown or something and there is no point in 
     704         * doing anything here except for emptying the clipboard and removing 
    705705         * ourselves as owner. Any failures at this point are silently ignored. 
    706706         */ 
     
    730730 
    731731        /* 
    732          * This is just a fallback polling strategy in case some other  
     732         * This is just a fallback polling strategy in case some other 
    733733         * app is trying to view the clipboard too. We also use this 
    734734         * to try recover from errors. 
     
    740740         */ 
    741741        case WM_TIMER: 
    742             if (    g_enmState != kClipboardState_Viewer  
     742            if (    g_enmState != kClipboardState_Viewer 
    743743                &&  g_enmState != kClipboardState_Polling) 
    744744                break; 
     
    758758 
    759759 
    760         /*  
     760        /* 
    761761         * Clipboard owner messages dealing with owner drawn content. 
    762762         * We shouldn't be seeing any of these. 
     
    771771        /* 
    772772         * We shouldn't be seeing any other messages according to the docs. 
    773          * But for whatever reason, PM sends us a WM_ADJUSTWINDOWPOS message  
     773         * But for whatever reason, PM sends us a WM_ADJUSTWINDOWPOS message 
    774774         * during WinCreateWindow. So, ignore that and assert on anything else. 
    775775         */ 
     
    785785/** 
    786786 * The listener thread. 
    787  *  
    788  * This thread is dedicated to listening for host messages and forwarding  
     787 * 
     788 * This thread is dedicated to listening for host messages and forwarding 
    789789 * these to the worker thread (using PM). 
    790  *  
     790 * 
    791791 * The thread will set g_fListenerOkay and signal its user event when it has 
    792792 * completed initialization. In the case of init failure g_fListenerOkay will 
    793793 * not be set. 
    794  *  
     794 * 
    795795 * @returns Init error code or VINF_SUCCESS. 
    796796 * @param   ThreadSelf  Our thread handle. 
     
    827827                rc = VbglR3ClipboardGetHostMsg(g_u32ClientId, &Msg, &fFormats); 
    828828                if (RT_SUCCESS(rc)) 
    829                 {                           
     829                { 
    830830                    VBoxServiceVerbose(3, "VBoxServiceClipboardOS2Listener: Msg=%#x  fFormats=%#x\n", Msg, fFormats); 
    831831                    switch (Msg) 
    832832                    { 
    833                         /*  
    834                          * The host has announced available clipboard formats.  
     833                        /* 
     834                         * The host has announced available clipboard formats. 
    835835                         * Forward the information to the window, so it can later 
    836836                         * respond do WM_RENDERFORMAT message. 
    837837                         */ 
    838838                        case VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS: 
    839                             if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS,  
     839                            if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS, 
    840840                                            MPFROMLONG(fFormats), 0)) 
    841                                 VBoxServiceError("WinPostMsg(%lx, FORMATS,,) failed, lasterr=%#lx\n",  
     841                                VBoxServiceError("WinPostMsg(%lx, FORMATS,,) failed, lasterr=%#lx\n", 
    842842                                                 g_hwndWorker, WinGetLastError(g_habListener)); 
    843843                            break; 
    844844 
    845                         /*  
     845                        /* 
    846846                         * The host needs data in the specified format. 
    847847                         */ 
    848848                        case VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA: 
    849                             if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA,  
     849                            if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA, 
    850850                                            MPFROMLONG(fFormats), 0)) 
    851                                 VBoxServiceError("WinPostMsg(%lx, READ_DATA,,) failed, lasterr=%#lx\n",  
     851                                VBoxServiceError("WinPostMsg(%lx, READ_DATA,,) failed, lasterr=%#lx\n", 
    852852                                                 g_hwndWorker, WinGetLastError(g_habListener)); 
    853853                            break; 
     
    918918                if (g_hwndWorker != NULLHANDLE) 
    919919                { 
    920                     VBoxServiceVerbose(3, "g_hwndWorker=%#lx g_habWorker=%#lx g_hmqWorker=%#lx\n", g_hwndWorker, g_habWorker, g_hmqWorker);  
     920                    VBoxServiceVerbose(3, "g_hwndWorker=%#lx g_habWorker=%#lx g_hmqWorker=%#lx\n", g_hwndWorker, g_habWorker, g_hmqWorker); 
    921921 
    922922                    /* 
     
    935935                        { 
    936936                            /* 
    937                              * Tell the control thread that it can continue  
     937                             * Tell the control thread that it can continue 
    938938                             * spawning services. 
    939939                             */ 
     
    10141014 * The OS/2 'clipboard' service description. 
    10151015 */ 
    1016 VBOXSERVICE g_Clipboard =  
     1016VBOXSERVICE g_Clipboard = 
    10171017{ 
    10181018    /* pszName. */ 
  • trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp

    <
    r8155 r8565  
    618618    { 
    619619        /* Check arguments. */ 
    620         AssertMsgBreak(cEntriesAlloc, 
    621                        ("cEntriesAlloc=%u\n", cEntriesAlloc), 
    622                        rc = VERR_INVALID_PARAMETER); 
    623         AssertMsgBreak(VALID_PTR(pEntries), 
    624                        ("pEntries=%#p\n", pEntries), 
    625                        rc = VERR_INVALID_PARAMETER); 
    626         AssertMsgBreak(VALID_PTR(pcEntriesUsed), 
    627                        ("pcEntriesUsed=%#p\n", pcEntriesUsed), 
    628                        rc = VERR_INVALID_PARAMETER); 
     620        AssertMsgBreakStmt(cEntriesAlloc, 
     621                           ("cEntriesAlloc=%u\n", cEntriesAlloc), 
     622                           rc = VERR_INVALID_PARAMETER); 
     623        AssertMsgBreakStmt(VALID_PTR(pEntries), 
     624                           ("pEntries=%#p\n", pEntries), 
     625                           rc = VERR_INVALID_PARAMETER); 
     626        AssertMsgBreakStmt(VALID_PTR(pcEntriesUsed), 
     627                           ("pcEntriesUsed=%#p\n", pcEntriesUsed), 
     628                           rc = VERR_INVALID_PARAMETER); 
    629629 
    630630        /* First enumerate static backends. */ 
     
    773773    { 
    774774        /* Check arguments. */ 
    775         AssertMsgBreak(VALID_PTR(pfnError), 
    776                        ("pfnError=%#p\n", pfnError), 
    777                        rc = VERR_INVALID_PARAMETER); 
    778         AssertMsgBreak(VALID_PTR(ppDisk), 
    779                        ("ppDisk=%#p\n", ppDisk), 
    780                        rc = VERR_INVALID_PARAMETER); 
     775        AssertMsgBreakStmt(VALID_PTR(pfnError), 
     776                           ("pfnError=%#p\n", pfnError), 
     777                           rc = VERR_INVALID_PARAMETER); 
     778        AssertMsgBreakStmt(VALID_PTR(ppDisk), 
     779                           ("ppDisk=%#p\n", ppDisk), 
     780                           rc = VERR_INVALID_PARAMETER); 
    781781 
    782782        pDisk = (PVBOXHDD)RTMemAllocZ(sizeof(VBOXHDD)); 
     
    854854    { 
    855855        /* Check arguments. */ 
    856         AssertMsgBreak(VALID_PTR(pszFilename) && *pszFilename, 
    857                        ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
    858                        rc = VERR_INVALID_PARAMETER); 
    859         AssertMsgBreak(VALID_PTR(ppszFormat), 
    860                        ("ppszFormat=%#p\n", ppszFormat), 
    861                        rc = VERR_INVALID_PARAMETER); 
     856        AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 
     857                           ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
     858                           rc = VERR_INVALID_PARAMETER); 
     859        AssertMsgBreakStmt(VALID_PTR(ppszFormat), 
     860                           ("ppszFormat=%#p\n", ppszFormat), 
     861                           rc = VERR_INVALID_PARAMETER); 
    862862 
    863863        /* First check if static backends support this file format. */ 
     
    10371037 
    10381038        /* Check arguments. */ 
    1039         AssertMsgBreak(VALID_PTR(pszBackend) && *pszBackend, 
    1040                        ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 
    1041                        rc = VERR_INVALID_PARAMETER); 
    1042         AssertMsgBreak(VALID_PTR(pszFilename) && *pszFilename, 
    1043                        ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
    1044                        rc = VERR_INVALID_PARAMETER); 
    1045         AssertMsgBreak((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 
    1046                        ("uOpenFlags=%#x\n", uOpenFlags), 
    1047                        rc = VERR_INVALID_PARAMETER); 
     1039        AssertMsgBreakStmt(VALID_PTR(pszBackend) && *pszBackend, 
     1040                           ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 
     1041                           rc = VERR_INVALID_PARAMETER); 
     1042        AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 
     1043                           ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
     1044                           rc = VERR_INVALID_PARAMETER); 
     1045        AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 
     1046                           ("uOpenFlags=%#x\n", uOpenFlags), 
     1047                           rc = VERR_INVALID_PARAMETER); 
    10481048 
    10491049        /* Force readonly for images without base/diff consistency checking. */ 
     
    12511251 
    12521252        /* Check arguments. */ 
    1253         AssertMsgBreak(VALID_PTR(pszBackend) && *pszBackend, 
    1254                        ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 
    1255                        rc = VERR_INVALID_PARAMETER); 
    1256         AssertMsgBreak(VALID_PTR(pszFilename) && *pszFilename, 
    1257                        ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
    1258                        rc = VERR_INVALID_PARAMETER); 
    1259         AssertMsgBreak(enmType == VD_IMAGE_TYPE_NORMAL || enmType == VD_IMAGE_TYPE_FIXED, 
    1260                        ("enmType=%#x\n", enmType), 
    1261                        rc = VERR_INVALID_PARAMETER); 
    1262         AssertMsgBreak(cbSize, 
    1263                        ("cbSize=%llu\n", cbSize), 
    1264                        rc = VERR_INVALID_PARAMETER); 
    1265         AssertMsgBreak((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0, 
    1266                        ("uImageFlags=%#x\n", uImageFlags), 
    1267                        rc = VERR_INVALID_PARAMETER); 
     1253        AssertMsgBreakStmt(VALID_PTR(pszBackend) && *pszBackend, 
     1254                           ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 
     1255                           rc = VERR_INVALID_PARAMETER); 
     1256        AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 
     1257                           ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
     1258                           rc = VERR_INVALID_PARAMETER); 
     1259        AssertMsgBreakStmt(enmType == VD_IMAGE_TYPE_NORMAL || enmType == VD_IMAGE_TYPE_FIXED, 
     1260                           ("enmType=%#x\n", enmType), 
     1261                           rc = VERR_INVALID_PARAMETER); 
     1262        AssertMsgBreakStmt(cbSize, 
     1263                           ("cbSize=%llu\n", cbSize), 
     1264                           rc = VERR_INVALID_PARAMETER); 
     1265        AssertMsgBreakStmt((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0, 
     1266                           ("uImageFlags=%#x\n", uImageFlags), 
     1267                           rc = VERR_INVALID_PARAMETER); 
    12681268        /* The PCHS geometry fields may be 0 to leave it for later. */ 
    1269         AssertMsgBreak(   VALID_PTR(pPCHSGeometry) 
    1270                        && pPCHSGeometry->cCylinders <= 16383 
    1271                        && pPCHSGeometry->cHeads <= 16 
    1272                        && pPCHSGeometry->cSectors <= 63, 
    1273                        ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry, 
    1274                         pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, 
    1275                         pPCHSGeometry->cSectors), 
    1276                        rc = VERR_INVALID_PARAMETER); 
     1269        AssertMsgBreakStmt(   VALID_PTR(pPCHSGeometry) 
     1270                           && pPCHSGeometry->cCylinders <= 16383 
     1271                           && pPCHSGeometry->cHeads <= 16 
     1272                           && pPCHSGeometry->cSectors <= 63, 
     1273                           ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry, 
     1274                            pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, 
     1275                            pPCHSGeometry->cSectors), 
     1276                           rc = VERR_INVALID_PARAMETER); 
    12771277        /* The LCHS geometry fields may be 0 to leave it to later autodetection. */ 
    1278         AssertMsgBreak(   VALID_PTR(pLCHSGeometry) 
    1279                        && pLCHSGeometry->cCylinders <= 1024 
    1280                        && pLCHSGeometry->cHeads <= 255 
    1281                        && pLCHSGeometry->cSectors <= 63, 
    1282                        ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry, 
    1283                         pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, 
    1284                         pLCHSGeometry->cSectors), 
    1285                        rc = VERR_INVALID_PARAMETER); 
    1286         AssertMsgBreak((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 
    1287                        ("uOpenFlags=%#x\n", uOpenFlags), 
    1288                        rc = VERR_INVALID_PARAMETER); 
     1278        AssertMsgBreakStmt(   VALID_PTR(pLCHSGeometry) 
     1279                           && pLCHSGeometry->cCylinders <= 1024 
     1280                           && pLCHSGeometry->cHeads <= 255 
     1281                           && pLCHSGeometry->cSectors <= 63, 
     1282                           ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry, 
     1283                            pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, 
     1284                            pLCHSGeometry->cSectors), 
     1285                           rc = VERR_INVALID_PARAMETER); 
     1286        AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 
     1287                           ("uOpenFlags=%#x\n", uOpenFlags), 
     1288                           rc = VERR_INVALID_PARAMETER); 
    12891289 
    12901290        /* Check state. */ 
    1291         AssertMsgBreak(pDisk->cImages == 0, 
    1292                        ("Create base image cannot be done with other images open\n"), 
    1293                        rc = VERR_VDI_INVALID_STATE); 
     1291        AssertMsgBreakStmt(pDisk->cImages == 0, 
     1292                           ("Create base image cannot be done with other images open\n"), 
     1293                           rc = VERR_VDI_INVALID_STATE); 
    12941294 
    12951295        /* Set up image descriptor. */ 
     
    14441444 
    14451445        /* Check arguments. */ 
    1446         AssertMsgBreak(VALID_PTR(pszBackend) && *pszBackend, 
    1447                        ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 
    1448                        rc = VERR_INVALID_PARAMETER); 
    1449         AssertMsgBreak(VALID_PTR(pszFilename) && *pszFilename, 
    1450                        ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
    1451                        rc = VERR_INVALID_PARAMETER); 
    1452         AssertMsgBreak((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0, 
    1453                        ("uImageFlags=%#x\n", uImageFlags), 
    1454                        rc = VERR_INVALID_PARAMETER); 
    1455         AssertMsgBreak((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 
    1456                        ("uOpenFlags=%#x\n", uOpenFlags), 
    1457                        rc = VERR_INVALID_PARAMETER); 
     1446        AssertMsgBreakStmt(VALID_PTR(pszBackend) && *pszBackend, 
     1447                           ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 
     1448                           rc = VERR_INVALID_PARAMETER); 
     1449        AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 
     1450                           ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
     1451                           rc = VERR_INVALID_PARAMETER); 
     1452        AssertMsgBreakStmt((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0, 
     1453                           ("uImageFlags=%#x\n", uImageFlags), 
     1454                           rc = VERR_INVALID_PARAMETER); 
     1455        AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 
     1456                           ("uOpenFlags=%#x\n", uOpenFlags), 
     1457                           rc = VERR_INVALID_PARAMETER); 
    14581458 
    14591459        /* Check state. */ 
    1460         AssertMsgBreak(pDisk->cImages != 0, 
    1461                        ("Create diff image cannot be done without other images open\n"), 
    1462                        rc = VERR_VDI_INVALID_STATE); 
     1460        AssertMsgBreakStmt(pDisk->cImages != 0, 
     1461                           ("Create diff image cannot be done without other images open\n"), 
     1462                           rc = VERR_VDI_INVALID_STATE); 
    14631463 
    14641464        /* Set up image descriptor. */ 
     
    18221822    do { 
    18231823        /* Check arguments. */ 
    1824         AssertMsgBreak(VALID_PTR(pDiskFrom), ("pDiskFrom=%#p\n", pDiskFrom), 
    1825                        rc = VERR_INVALID_PARAMETER); 
     1824        AssertMsgBreakStmt(VALID_PTR(pDiskFrom), ("pDiskFrom=%#p\n", pDiskFrom), 
     1825                           rc = VERR_INVALID_PARAMETER); 
    18261826        AssertMsg(pDiskFrom->u32Signature == VBOXHDDDISK_SIGNATURE, 
    18271827                  ("u32Signature=%08x\n", pDiskFrom->u32Signature)); 
     
    18291829        PVDIMAGE pImageFrom = vdGetImageByNumber(pDiskFrom, nImage); 
    18301830        AssertBreak(VALID_PTR(pImageFrom), rc = VERR_VDI_IMAGE_NOT_FOUND); 
    1831         AssertMsgBreak(VALID_PTR(pDiskTo), ("pDiskTo=%#p\n", pDiskTo), 
    1832                        rc = VERR_INVALID_PARAMETER); 
     1831        AssertMsgBreakStmt(VALID_PTR(pDiskTo), ("pDiskTo=%#p\n", pDiskTo), 
     1832                           rc = VERR_INVALID_PARAMETER); 
    18331833        AssertMsg(pDiskTo->u32Signature == VBOXHDDDISK_SIGNATURE, 
    18341834                  ("u32Signature=%08x\n", pDiskTo->u32Signature)); 
     
    18871887 
    18881888        /* If fMoveByRename is set pszFilename is allowed to be NULL, so do the parameter check here. */ 
    1889         AssertMsgBreak(VALID_PTR(pszFilename) && *pszFilename, 
    1890                        ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
    1891                        rc = VERR_INVALID_PARAMETER); 
     1889        AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 
     1890                           ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 
     1891                           rc = VERR_INVALID_PARAMETER); 
    18921892 
    18931893        /* Collect properties of source image. */ 
     
    21932193 
    21942194        /* Check arguments. */ 
    2195         AssertMsgBreak(VALID_PTR(pvBuf), 
    2196                        ("pvBuf=%#p\n", pvBuf), 
    2197                        rc = VERR_INVALID_PARAMETER); 
    2198         AssertMsgBreak(cbRead, 
    2199                        ("cbRead=%zu\n", cbRead), 
    2200                        rc = VERR_INVALID_PARAMETER); 
    2201         AssertMsgBreak(uOffset + cbRead <= pDisk->cbSize, 
    2202                        ("uOffset=%llu cbRead=%zu pDisk->cbSize=%llu\n", 
    2203                         uOffset, cbRead, pDisk->cbSize), 
    2204                        rc = VERR_INVALID_PARAMETER); 
     2195        AssertMsgBreakStmt(VALID_PTR(pvBuf), 
     2196                           ("pvBuf=%#p\n", pvBuf), 
     2197                           rc = VERR_INVALID_PARAMETER); 
     2198        AssertMsgBreakStmt(cbRead, 
     2199                           ("cbRead=%zu\n", cbRead), 
     2200                           rc = VERR_INVALID_PARAMETER); 
     2201        AssertMsgBreakStmt(uOffset + cbRead <= pDisk->cbSize, 
     2202                           ("uOffset=%llu cbRead=%zu pDisk->cbSize=%llu\n", 
     2203                            uOffset, cbRead, pDisk->cbSize), 
     2204                           rc = VERR_INVALID_PARAMETER); 
    22052205 
    22062206        PVDIMAGE pImage = pDisk->pLast; 
     
    22382238 
    22392239        /* Check arguments. */ 
    2240         AssertMsgBreak(VALID_PTR(pvBuf), 
    2241                        ("pvBuf=%#p\n", pvBuf), 
    2242                        rc = VERR_INVALID_PARAMETER); 
    2243         AssertMsgBreak(cbWrite, 
    2244                        ("cbWrite=%zu\n", cbWrite), 
    2245                        rc = VERR_INVALID_PARAMETER); 
    2246         AssertMsgBreak(uOffset + cbWrite <= pDisk->cbSize, 
    2247                        ("uOffset=%llu cbWrite=%zu pDisk->cbSize=%llu\n", 
    2248                         uOffset, cbWrite, pDisk->cbSize), 
    2249                        rc = VERR_INVALID_PARAMETER); 
     2240        AssertMsgBreakStmt(VALID_PTR(pvBuf), 
     2241                           ("pvBuf=%#p\n", pvBuf), 
     2242                           rc = VERR_INVALID_PARAMETER); 
     2243        AssertMsgBreakStmt(cbWrite, 
     2244                           ("cbWrite=%zu\n", cbWrite), 
     2245                           rc = VERR_INVALID_PARAMETER); 
     2246        AssertMsgBreakStmt(uOffset + cbWrite <= pDisk->cbSize, 
     2247                           ("uOffset=%llu cbWrite=%zu pDisk->cbSize=%llu\n", 
     2248                            uOffset, cbWrite, pDisk->cbSize), 
     2249                           rc = VERR_INVALID_PARAMETER); 
    22502250 
    22512251        PVDIMAGE pImage = pDisk->pLast; 
     
    24232423 
    24242424        /* Check arguments. */ 
    2425         AssertMsgBreak(VALID_PTR(pPCHSGeometry), 
    2426                        ("pPCHSGeometry=%#p\n", pPCHSGeometry), 
    2427                        rc = VERR_INVALID_PARAMETER); 
     2425        AssertMsgBreakStmt(VALID_PTR(pPCHSGeometry), 
     2426                           ("pPCHSGeometry=%#p\n", pPCHSGeometry), 
     2427                           rc = VERR_INVALID_PARAMETER); 
    24282428 
    24292429        PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 
     
    24762476 
    24772477        /* Check arguments. */ 
    2478         AssertMsgBreak(   VALID_PTR(pPCHSGeometry) 
    2479                        && pPCHSGeometry->cCylinders <= 16383 
    2480                        && pPCHSGeometry->cHeads <= 16 
    2481                        && pPCHSGeometry->cSectors <= 63, 
    2482                        ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry, 
    2483                         pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, 
    2484                         pPCHSGeometry->cSectors), 
    2485                        rc = VERR_INVALID_PARAMETER); 
     2478        AssertMsgBreakStmt(   VALID_PTR(pPCHSGeometry) 
     2479                           && pPCHSGeometry->cCylinders <= 16383 
     2480                           && pPCHSGeometry->cHeads <= 16 
     2481                           && pPCHSGeometry->cSectors <= 63, 
     2482                           ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry, 
     2483                            pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, 
     2484                            pPCHSGeometry->cSectors), 
     2485                           rc = VERR_INVALID_PARAMETER); 
    24862486 
    24872487        PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 
     
    25692569 
    25702570        /* Check arguments. */ 
    2571         AssertMsgBreak(VALID_PTR(pLCHSGeometry), 
    2572                        ("pLCHSGeometry=%#p\n", pLCHSGeometry), 
    2573                        rc = VERR_INVALID_PARAMETER); 
     2571        AssertMsgBreakStmt(VALID_PTR(pLCHSGeometry), 
     2572                           ("pLCHSGeometry=%#p\n", pLCHSGeometry), 
     2573                           rc = VERR_INVALID_PARAMETER); 
    25742574 
    25752575        PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 
     
    26222622 
    26232623        /* Check arguments. */ 
    2624         AssertMsgBreak(   VALID_PTR(pLCHSGeometry) 
    2625                        && pLCHSGeometry->cCylinders <= 1024 
    2626                        && pLCHSGeometry->cHeads <= 255 
    2627                        && pLCHSGeometry->cSectors <= 63, 
    2628                        ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry, 
    2629                         pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, 
    2630                         pLCHSGeometry->cSectors), 
    2631                        rc = VERR_INVALID_PARAMETER); 
     2624        AssertMsgBreakStmt(   VALID_PTR(pLCHSGeometry) 
     2625                           && pLCHSGeometry->cCylinders <= 1024 
     2626                           && pLCHSGeometry->cHeads <= 255 
     2627                           && pLCHSGeometry->cSectors <= 63, 
     2628                           ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry, 
     2629                            pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, 
     2630                            pLCHSGeometry->cSectors), 
     2631                           rc = VERR_INVALID_PARAMETER); 
    26322632 
    26332633        PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 
     
    27142714 
    27152715        /* Check arguments. */ 
    2716         AssertMsgBreak(VALID_PTR(puVersion), 
    2717                        ("puVersion=%#p\n", puVersion), 
    2718                        rc = VERR_INVALID_PARAMETER); 
     2716        AssertMsgBreakStmt(VALID_PTR(puVersion), 
     2717                           ("puVersion=%#p\n", puVersion), 
     2718                           rc = VERR_INVALID_PARAMETER); 
    27192719 
    27202720        PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 
     
    27512751 
    27522752        /* Check arguments. */ 
    2753         AssertMsgBreak(VALID_PTR(penmType), 
    2754                        ("penmType=%#p\n", penmType), 
    2755                        rc = VERR_INVALID_PARAMETER); 
     2753        AssertMsgBreakStmt(VALID_PTR(penmType), 
     2754                           ("penmType=%#p\n", penmType), 
     2755                           rc = VERR_INVALID_PARAMETER); 
    27562756 
    27572757        PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 
     
    27892789 
    27902790        /* Check arguments. */ 
    2791         AssertMsgBreak(VALID_PTR(puImageFlags), 
    2792                        ("puImageFlags=%#p\n", puImageFlags), 
    2793                        rc = VERR_INVALID_PARAMETER); 
     2791        AssertMsgBreakStmt(VALID_PTR(puImageFlags), 
     2792                           ("puImageFlags=%#p\n", puImageFlags), 
     2793                           rc = VERR_INVALID_PARAMETER); 
    27942794 
    27952795        PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); 
     
    28262826 
    28272827        /* Check arguments. */