VirtualBox

Changeset 63158 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 8, 2016 12:23:27 PM (8 years ago)
Author:
vboxsync
Message:

Main: More warnings about uninitialized variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp

    r59842 r63158  
    840840    int rc;
    841841
    842     uint32_t uProto        = 0;
    843     uint32_t uVerAdditions = 0;
    844     uint32_t uRevAdditions = 0;
     842    uint32_t uProto = 0;
     843    uint32_t uVerAdditions;
     844    uint32_t uRevAdditions;
    845845    if (   m_pGuest
    846846        && (uVerAdditions = m_pGuest->i_getAdditionsVersion())  > 0
    847847        && (uRevAdditions = m_pGuest->i_getAdditionsRevision()) > 0)
    848848    {
    849 #ifdef DEBUG
    850 # if 0
     849#if 0 && defined(DEBUG)
    851850        /* Hardcode the to-used protocol version; nice for testing side effects. */
    852         uProto = 3;
     851        if (true)
     852            uProto = 3;
     853        else
     854#endif
     855        if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 0))
     856        {
     857/** @todo
     858 *  r=bird: This is just too bad for anyone using an OSE additions build...
     859 */
     860            if (uRevAdditions >= 103344) /* Since r103344: Protocol v3. */
     861                uProto = 3;
     862            else
     863                uProto = 2; /* VBox 5.0.0 - 5.0.8: Protocol v2. */
     864        }
     865        /* else: uProto: 0 */
     866
     867        LogFlowFunc(("uVerAdditions=%RU32 (%RU32.%RU32.%RU32), r%RU32\n",
     868                     uVerAdditions, VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions), VBOX_FULL_VERSION_GET_MINOR(uVerAdditions),
     869                                    VBOX_FULL_VERSION_GET_BUILD(uVerAdditions), uRevAdditions));
    853870        rc = VINF_SUCCESS;
    854 # endif
    855 #endif
    856         if (!uProto) /* Protocol not set yet? */
    857         {
    858             if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 0))
    859             {
    860                 if (uRevAdditions >= 103344) /* Since r103344: Protocol v3. */
    861                 {
    862                     uProto = 3;
    863                 }
    864                 else
    865                     uProto = 2; /* VBox 5.0.0 - 5.0.8: Protocol v2. */
    866             }
    867 
    868             LogFlowFunc(("uVerAdditions=%RU32 (%RU32.%RU32.%RU32), r%RU32\n",
    869                          uVerAdditions, VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions), VBOX_FULL_VERSION_GET_MINOR(uVerAdditions),
    870                                         VBOX_FULL_VERSION_GET_BUILD(uVerAdditions), uRevAdditions));
    871             rc = VINF_SUCCESS;
    872         }
    873871    }
    874872    else
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