VirtualBox

Ignore:
Timestamp:
Nov 26, 2009 3:26:36 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55327
Message:

RTStrVersionCompare: made it return the same as RTStrICmp (-1,0,1).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/strversion.cpp

    r25005 r25014  
    111111     * Do a parallel parse of the strings.
    112112     */
    113     int iRes = 0;
    114113    while (*pszVer1 || *pszVer2)
    115114    {
     
    127126        {
    128127            if (uVal1 != uVal2)
    129             {
    130                 iRes = uVal1 > uVal2 ? 1 : 2;
    131                 break;
    132             }
     128                return uVal1 < uVal2 ? -1 : 1;
    133129        }
    134130        else if (   !fNumeric1 && fNumeric2 && uVal2 == 0 && cchBlock1 == 0
     
    144140                iDiff = cchBlock1 < cchBlock2 ? -1 : 1;
    145141            if (iDiff)
    146             {
    147                 iRes = iDiff > 0 ? 1 : 2;
    148                 break;
    149             }
     142                return iDiff < 0 ? -1 : 1;
    150143        }
    151144    }
    152     return iRes;
     145    return 0;
    153146}
    154147RT_EXPORT_SYMBOL(RTStrVersionCompare);
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