VirtualBox

Changeset 76603 in vbox


Ignore:
Timestamp:
Jan 2, 2019 4:35:58 AM (6 years ago)
Author:
vboxsync
Message:

UIDefs.h: Drop SIZEOF_ARRAY as we've got RT_ELEMENTS for that. Assertions shall be active when RT/VBOX_STRICT is defined rather than when DEBUG is.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r76581 r76603  
    2222#endif
    2323
     24/* Define GUI log group: */
     25// WORKAROUND:
     26// This define should go *before* VBox/log.h include!
     27#define LOG_GROUP LOG_GROUP_GUI
     28
    2429/* Qt includes: */
    2530#include <QEvent>
     
    3237#include "COMEnums.h"
    3338
    34 /* Define GUI log group: */
    35 // WORKAROUND:
    36 // This define should go *before* VBox/log.h include!
    37 #ifndef VBOX_WITH_PRECOMPILED_HEADERS
    38 # define LOG_GROUP LOG_GROUP_GUI
    39 #endif
    40 
    4139/* Other VBox includes: */
    4240#include <VBox/log.h>
     
    4442
    4543/* Defines: */
    46 #ifdef DEBUG
    47 # define AssertWrapperOk(w)      \
    48     AssertMsg (w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC()))
    49 # define AssertWrapperOkMsg(w, m)      \
    50     AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC()))
    51 #else /* !DEBUG */
    52 # define AssertWrapperOk(w)          do {} while (0)
    53 # define AssertWrapperOkMsg(w, m)    do {} while (0)
    54 #endif /* !DEBUG */
    55 
    56 #ifndef SIZEOF_ARRAY
    57 # define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
     44#ifdef RT_STRICT
     45# define AssertWrapperOk(w)         AssertMsg(w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC()))
     46# define AssertWrapperOkMsg(w, m)   AssertMsg(w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC()))
     47#else
     48# define AssertWrapperOk(w)         do {} while (0)
     49# define AssertWrapperOkMsg(w, m)   do {} while (0)
    5850#endif
    5951
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r76553 r76603  
    404404     * a sequence of all modifier keys contained in the host sequence, hoping
    405405     * that the user will choose something which the guest does not interpret. */
    406     for (uint i = 0; i < SIZEOF_ARRAY (m_pressedKeys); i++)
     406    for (uint i = 0; i < RT_ELEMENTS(m_pressedKeys); i++)
    407407    {
    408408        if ((m_pressedKeys[i] & IsKeyPressed) || (m_pressedKeys[i] & IsExtKeyPressed))
     
    16261626                static LONG PrintMake[] = { 0xE0, 0x2A, 0xE0, 0x37 };
    16271627                pCodes = PrintMake;
    1628                 uCodesCount = SIZEOF_ARRAY(PrintMake);
     1628                uCodesCount = RT_ELEMENTS(PrintMake);
    16291629            }
    16301630            else
     
    16321632                static LONG PrintBreak[] = { 0xE0, 0xB7, 0xE0, 0xAA };
    16331633                pCodes = PrintBreak;
    1634                 uCodesCount = SIZEOF_ARRAY(PrintBreak);
     1634                uCodesCount = RT_ELEMENTS(PrintBreak);
    16351635            }
    16361636        }
     
    16421642                static LONG Pause[] = { 0xE1, 0x1D, 0x45, 0xE1, 0x9D, 0xC5 };
    16431643                pCodes = Pause;
    1644                 uCodesCount = SIZEOF_ARRAY(Pause);
     1644                uCodesCount = RT_ELEMENTS(Pause);
    16451645            }
    16461646            else
     
    18571857{
    18581858    QVector <LONG> codes(2);
    1859     for (uint i = 0; i < SIZEOF_ARRAY(m_pressedKeys); ++ i)
     1859    for (uint i = 0; i < RT_ELEMENTS(m_pressedKeys); ++ i)
    18601860    {
    18611861        uint8_t os = m_pressedKeysCopy[i];
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