VirtualBox

Changeset 85262 in vbox


Ignore:
Timestamp:
Jul 12, 2020 12:11:47 AM (4 years ago)
Author:
vboxsync
Message:

Main/VirtualBoxImpl.cpp: Signed/unsigned conversion issues. Left a couple of TODOs behind. bugref:9790

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r85121 r85262  
    11911191    uRevision |= 1;
    11921192
    1193     *aAPIRevision = uRevision;
     1193    *aAPIRevision = (LONG64)uRevision;
    11941194
    11951195    return S_OK;
     
    19141914        return rc;
    19151915
    1916     Utf8Str strCreateFlags(aFlags);
     1916    /** @todo r=bird: Would be goot to rewrite this parsing using offset into
     1917     *        aFlags and drop all the C pointers, strchr, misguided RTStrStr and
     1918     *        tedious copying of substrings. */
     1919    Utf8Str strCreateFlags(aFlags); /** @todo r=bird: WTF is the point of this copy? */
    19171920    Guid id;
    19181921    bool fForceOverwrite = false;
     
    19241927        {
    19251928            Utf8Str strFlag;
    1926             const char *pcszComma = RTStrStr(pcszNext, ",");
     1929            const char *pcszComma = strchr(pcszNext, ','); /*clueless version: RTStrStr(pcszNext, ","); */
    19271930            if (!pcszComma)
    19281931                strFlag = pcszNext;
    19291932            else
    1930                 strFlag = Utf8Str(pcszNext, pcszComma - pcszNext);
    1931 
    1932             const char *pcszEqual = RTStrStr(strFlag.c_str(), "=");
     1933                strFlag.assign(pcszNext, (size_t)(pcszComma - pcszNext));
     1934
     1935            const char *pcszEqual = strchr(strFlag.c_str(), '='); /* more cluelessness: RTStrStr(strFlag.c_str(), "="); */
    19331936            /* skip over everything which doesn't contain '=' */
    19341937            if (pcszEqual && pcszEqual != strFlag.c_str())
    19351938            {
    1936                 Utf8Str strKey(strFlag.c_str(), pcszEqual - strFlag.c_str());
     1939                Utf8Str strKey(strFlag.c_str(), (size_t)(pcszEqual - strFlag.c_str()));
    19371940                Utf8Str strValue(strFlag.c_str() + (pcszEqual - strFlag.c_str() + 1));
    19381941
     
    19461949
    19471950            if (!pcszComma)
    1948                 pcszNext += strFlag.length();
     1951                pcszNext += strFlag.length();  /* you can just 'break' out here... */
    19491952            else
    19501953                pcszNext += strFlag.length() + 1;
    19511954        }
    19521955    }
     1956
    19531957    /* Create UUID if none was specified. */
    19541958    if (id.isZero())
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