Changeset 17091 in vbox for trunk/src/VBox/HostDrivers/Support/testcase
- Timestamp:
- Feb 24, 2009 7:55:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r13837 r17091 53 53 * Parse args 54 54 */ 55 static const RT OPTIONDEF g_aOptions[] =55 static const RTGETOPTDEF g_aOptions[] = 56 56 { 57 57 { "--interations", 'i', RTGETOPT_REQ_INT32 }, … … 65 65 bool fSpin = false; 66 66 int ch; 67 int iArg = 1; 68 RTOPTIONUNION ValueUnion; 69 while ((ch = RTGetOpt(argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), &iArg, &ValueUnion))) 67 RTGETOPTUNION ValueUnion; 68 RTGETOPTSTATE GetState; 69 RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0 /* fFlags */); 70 while ((ch = RTGetOpt(&GetState, &ValueUnion))) 70 71 { 71 72 switch (ch) … … 87 88 break; 88 89 90 case VINF_GETOPT_NOT_OPTION: 91 RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz); 92 return 1; 93 89 94 default: 90 95 if (ch < 0) … … 94 99 return 1; 95 100 } 96 }97 if (iArg < argc)98 {99 RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz);100 return 1;101 101 } 102 102
Note:
See TracChangeset
for help on using the changeset viewer.