VirtualBox

Changeset 25323 in vbox


Ignore:
Timestamp:
Dec 11, 2009 12:27:17 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55902
Message:

iprt/getopt.h/cpp: Made the uIndex 32-bit instead of 64-bit as we don't need 64-bit and it only causes lots of warnings when compiling VBoxManage with MSC.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/getopt.h

    r25317 r25323  
    203203    /** The option definition which matched. NULL otherwise. */
    204204    PCRTGETOPTDEF   pDef;
    205     /** The index of an index option, otherwise UINT64_MAX. */
    206     uint64_t        uIndex;
     205    /** The index of an index option, otherwise UINT32_MAX. */
     206    uint32_t        uIndex;
    207207    /* More members will be added later for dealing with initial
    208208       call, optional sorting, '--' and so on. */
  • trunk/src/VBox/Runtime/common/misc/getopt.cpp

    r24825 r25323  
    401401     */
    402402    pState->pDef = NULL;
    403     pState->uIndex = UINT64_MAX;
     403    pState->uIndex = UINT32_MAX;
    404404
    405405    /*
     
    512512                        return VERR_GETOPT_INDEX_MISSING;
    513513
    514                     uint64_t uIndex;
     514                    uint32_t uIndex;
    515515                    char *pszRet = NULL;
    516                     int rc = RTStrToUInt64Ex(&pszArgThis[cchLong], &pszRet, 10, &uIndex);
     516                    int rc = RTStrToUInt32Ex(&pszArgThis[cchLong], &pszRet, 10, &uIndex);
    517517                    if (rc == VWRN_TRAILING_CHARS)
    518518                    {
     
    584584                return VERR_GETOPT_INDEX_MISSING;
    585585
    586             uint64_t uIndex;
     586            uint32_t uIndex;
    587587            char *pszRet = NULL;
    588             if (RTStrToUInt64Full(&pszArgThis[cchLong], 10, &uIndex) == VINF_SUCCESS)
     588            if (RTStrToUInt32Full(&pszArgThis[cchLong], 10, &uIndex) == VINF_SUCCESS)
    589589                pState->uIndex = uIndex;
    590590            else
  • trunk/src/VBox/Runtime/testcase/tstGetOpt.cpp

    r24140 r25323  
    172172    CHECK_GETOPT(RTGetOpt(&GetState, &Val), 's', 2);
    173173    CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "string1"));
    174     CHECK(GetState.uIndex == UINT64_MAX);
     174    CHECK(GetState.uIndex == UINT32_MAX);
    175175    CHECK_GETOPT(RTGetOpt(&GetState, &Val), 's', 2);
    176176    CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "string2"));
    177     CHECK(GetState.uIndex == UINT64_MAX);
     177    CHECK(GetState.uIndex == UINT32_MAX);
    178178
    179179    /* -i */
     
    301301
    302302    CHECK_GETOPT(RTGetOpt(&GetState, &Val), 404, 1);
    303     CHECK(GetState.uIndex == UINT64_MAX);
     303    CHECK(GetState.uIndex == UINT32_MAX);
    304304
    305305    /* RTGetOptFetchValue tests */
    306306    CHECK_GETOPT(RTGetOpt(&GetState, &Val), 405, 2);
    307307    CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "firstvalue"));
    308     CHECK(GetState.uIndex == UINT64_MAX);
     308    CHECK(GetState.uIndex == UINT32_MAX);
    309309    CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_STRING), VINF_SUCCESS, 1);
    310310    CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "secondvalue"));
    311     CHECK(GetState.uIndex == UINT64_MAX);
     311    CHECK(GetState.uIndex == UINT32_MAX);
    312312
    313313    CHECK_GETOPT(RTGetOpt(&GetState, &Val), 405, 1);
    314314    CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "firstvalue"));
    315     CHECK(GetState.uIndex == UINT64_MAX);
     315    CHECK(GetState.uIndex == UINT32_MAX);
    316316    CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_STRING), VINF_SUCCESS, 1);
    317317    CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "secondvalue"));
    318     CHECK(GetState.uIndex == UINT64_MAX);
     318    CHECK(GetState.uIndex == UINT32_MAX);
    319319
    320320    CHECK_GETOPT(RTGetOpt(&GetState, &Val), 406, 2);
     
    334334    CHECK_GETOPT(RTGetOpt(&GetState, &Val), 407, 2);
    335335    CHECK(Val.u32 == 1);
    336     CHECK(GetState.uIndex == UINT64_MAX);
     336    CHECK(GetState.uIndex == UINT32_MAX);
    337337    CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_UINT32), VINF_SUCCESS, 1);
    338338    CHECK(Val.u32 == 12);
    339     CHECK(GetState.uIndex == UINT64_MAX);
     339    CHECK(GetState.uIndex == UINT32_MAX);
    340340    CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_STRING), VINF_SUCCESS, 1);
    341341    CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "thirdvalue"));
    342     CHECK(GetState.uIndex == UINT64_MAX);
     342    CHECK(GetState.uIndex == UINT32_MAX);
    343343
    344344    /* bool on/off tests */
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