VirtualBox

Ignore:
Timestamp:
Apr 11, 2008 8:32:20 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
29576
Message:

move variables around to be able to compile this as .c (debug kernel module)

File:
1 edited

Legend:

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

    r7169 r7942  
    106106RTDECL(int) RTStrToUInt64Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint64_t *pu64)
    107107{
    108     const char *psz = pszValue;
     108    const char   *psz = pszValue;
     109    int           iShift;
     110    int           rc;
     111    uint64_t      u64;
     112    unsigned char uch;
    109113
    110114    /*
     
    153157     * Note: We only support ascii digits at this time... :-)
    154158     */
    155     int             iShift = g_auchShift[uBase];
     159    iShift = g_auchShift[uBase];
    156160    pszValue = psz; /* (Prefix and sign doesn't count in the digit counting.) */
    157     int             rc = VINF_SUCCESS;
    158     uint64_t        u64 = 0;
    159     unsigned char   uch;
     161    rc = VINF_SUCCESS;
     162    u64 = 0;
    160163    while ((uch = (unsigned char)*psz) != 0)
    161164    {
    162165        unsigned char chDigit = g_auchDigits[uch];
     166        uint64_t u64Prev;
     167
    163168        if (chDigit >= uBase)
    164169            break;
    165170
    166         uint64_t u64Prev = u64;
     171        u64Prev = u64;
    167172        u64 *= uBase;
    168173        u64 += chDigit;
     
    534539RTDECL(int) RTStrToInt64Ex(const char *pszValue, char **ppszNext, unsigned uBase, int64_t *pi64)
    535540{
    536     const char *psz = pszValue;
     541    const char   *psz = pszValue;
     542    int           iShift;
     543    int           rc;
     544    int64_t       i64;
     545    unsigned char uch;
    537546
    538547    /*
     
    581590     * Note: We only support ascii digits at this time... :-)
    582591     */
    583     int             iShift = g_auchShift[uBase]; /** @todo test this, it's probably not 100% right yet. */
     592    iShift = g_auchShift[uBase]; /** @todo test this, it's probably not 100% right yet. */
    584593    pszValue = psz; /* (Prefix and sign doesn't count in the digit counting.) */
    585     int             rc = VINF_SUCCESS;
    586     int64_t         i64 = 0;
    587     unsigned char   uch;
     594    rc = VINF_SUCCESS;
     595    i64 = 0;
    588596    while ((uch = (unsigned char)*psz) != 0)
    589597    {
    590598        unsigned char chDigit = g_auchDigits[uch];
     599        int64_t i64Prev;
     600
    591601        if (chDigit >= uBase)
    592602            break;
    593603
    594         int64_t i64Prev = i64;
     604        i64Prev = i64;
    595605        i64 *= uBase;
    596606        i64 += chDigit;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette