Changes in benchmark/readyQ/rq_bench.hpp [f9b2e73:c4241b6]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/rq_bench.hpp
rf9b2e73 rc4241b6 97 97 } 98 98 99 bool parse_truefalse(const char * arg, bool & value) { 100 if(strcmp(arg, "true") == 0) { 101 value = true; 102 return true; 103 } 104 105 if(strcmp(arg, "false") == 0) { 106 value = false; 107 return true; 108 } 109 110 return false; 111 } 112 99 113 bool parse_settrue (const char *, bool & value ) { 100 114 value = true; … … 226 240 { 227 241 int idx = 0; 228 for( int i = 0; i < opt_count; i++) {242 for(size_t i = 0; i < opt_count; i++) { 229 243 if(options[i].long_name) { 230 244 optarr[idx].name = options[i].long_name; … … 256 270 { 257 271 int idx = 0; 258 for( int i = 0; i < opt_count; i++) {272 for(size_t i = 0; i < opt_count; i++) { 259 273 optstring[idx] = options[i].short_name; 260 274 idx++; … … 279 293 case 'h': 280 294 out = stdout; 295 [[fallthrough]]; 281 296 case '?': 282 297 usage(argv[0], options, opt_count, usage_msg, out); 283 298 default: 284 for( int i = 0; i < opt_count; i++) {299 for(size_t i = 0; i < opt_count; i++) { 285 300 if(opt == options[i].short_name) { 286 301 const char * arg = optarg ? optarg : ""; 302 if( arg[0] == '=' ) { arg++; } 287 303 bool success = options[i].parse_fun( arg, options[i].variable ); 288 304 if(success) goto NEXT_ARG; … … 319 335 int width = 0; 320 336 { 321 for( int i = 0; i < opt_count; i++) {337 for(size_t i = 0; i < opt_count; i++) { 322 338 if(options[i].long_name) { 323 339 int w = strlen(options[i].long_name); … … 338 354 fprintf(out, "Usage:\n %s %s\n", cmd, help); 339 355 340 for( int i = 0; i < opt_count; i++) {356 for(size_t i = 0; i < opt_count; i++) { 341 357 printopt(out, width, max_width, options[i].short_name, options[i].long_name, options[i].help); 342 358 }
Note: See TracChangeset
for help on using the changeset viewer.