Changeset 25323 in vbox
- Timestamp:
- Dec 11, 2009 12:27:17 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55902
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/getopt.h
r25317 r25323 203 203 /** The option definition which matched. NULL otherwise. */ 204 204 PCRTGETOPTDEF pDef; 205 /** The index of an index option, otherwise UINT 64_MAX. */206 uint 64_t uIndex;205 /** The index of an index option, otherwise UINT32_MAX. */ 206 uint32_t uIndex; 207 207 /* More members will be added later for dealing with initial 208 208 call, optional sorting, '--' and so on. */ -
trunk/src/VBox/Runtime/common/misc/getopt.cpp
r24825 r25323 401 401 */ 402 402 pState->pDef = NULL; 403 pState->uIndex = UINT 64_MAX;403 pState->uIndex = UINT32_MAX; 404 404 405 405 /* … … 512 512 return VERR_GETOPT_INDEX_MISSING; 513 513 514 uint 64_t uIndex;514 uint32_t uIndex; 515 515 char *pszRet = NULL; 516 int rc = RTStrToUInt 64Ex(&pszArgThis[cchLong], &pszRet, 10, &uIndex);516 int rc = RTStrToUInt32Ex(&pszArgThis[cchLong], &pszRet, 10, &uIndex); 517 517 if (rc == VWRN_TRAILING_CHARS) 518 518 { … … 584 584 return VERR_GETOPT_INDEX_MISSING; 585 585 586 uint 64_t uIndex;586 uint32_t uIndex; 587 587 char *pszRet = NULL; 588 if (RTStrToUInt 64Full(&pszArgThis[cchLong], 10, &uIndex) == VINF_SUCCESS)588 if (RTStrToUInt32Full(&pszArgThis[cchLong], 10, &uIndex) == VINF_SUCCESS) 589 589 pState->uIndex = uIndex; 590 590 else -
trunk/src/VBox/Runtime/testcase/tstGetOpt.cpp
r24140 r25323 172 172 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 's', 2); 173 173 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "string1")); 174 CHECK(GetState.uIndex == UINT 64_MAX);174 CHECK(GetState.uIndex == UINT32_MAX); 175 175 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 's', 2); 176 176 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "string2")); 177 CHECK(GetState.uIndex == UINT 64_MAX);177 CHECK(GetState.uIndex == UINT32_MAX); 178 178 179 179 /* -i */ … … 301 301 302 302 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 404, 1); 303 CHECK(GetState.uIndex == UINT 64_MAX);303 CHECK(GetState.uIndex == UINT32_MAX); 304 304 305 305 /* RTGetOptFetchValue tests */ 306 306 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 405, 2); 307 307 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "firstvalue")); 308 CHECK(GetState.uIndex == UINT 64_MAX);308 CHECK(GetState.uIndex == UINT32_MAX); 309 309 CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_STRING), VINF_SUCCESS, 1); 310 310 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "secondvalue")); 311 CHECK(GetState.uIndex == UINT 64_MAX);311 CHECK(GetState.uIndex == UINT32_MAX); 312 312 313 313 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 405, 1); 314 314 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "firstvalue")); 315 CHECK(GetState.uIndex == UINT 64_MAX);315 CHECK(GetState.uIndex == UINT32_MAX); 316 316 CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_STRING), VINF_SUCCESS, 1); 317 317 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "secondvalue")); 318 CHECK(GetState.uIndex == UINT 64_MAX);318 CHECK(GetState.uIndex == UINT32_MAX); 319 319 320 320 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 406, 2); … … 334 334 CHECK_GETOPT(RTGetOpt(&GetState, &Val), 407, 2); 335 335 CHECK(Val.u32 == 1); 336 CHECK(GetState.uIndex == UINT 64_MAX);336 CHECK(GetState.uIndex == UINT32_MAX); 337 337 CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_UINT32), VINF_SUCCESS, 1); 338 338 CHECK(Val.u32 == 12); 339 CHECK(GetState.uIndex == UINT 64_MAX);339 CHECK(GetState.uIndex == UINT32_MAX); 340 340 CHECK_GETOPT(RTGetOptFetchValue(&GetState, &Val, RTGETOPT_REQ_STRING), VINF_SUCCESS, 1); 341 341 CHECK(VALID_PTR(Val.psz) && !strcmp(Val.psz, "thirdvalue")); 342 CHECK(GetState.uIndex == UINT 64_MAX);342 CHECK(GetState.uIndex == UINT32_MAX); 343 343 344 344 /* bool on/off tests */
Note:
See TracChangeset
for help on using the changeset viewer.