Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/rq_bench.hpp

    rf9b2e73 rc4241b6  
    9797}
    9898
     99bool 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
    99113bool parse_settrue (const char *, bool & value ) {
    100114        value = true;
     
    226240        {
    227241                int idx = 0;
    228                 for(int i = 0; i < opt_count; i++) {
     242                for(size_t i = 0; i < opt_count; i++) {
    229243                        if(options[i].long_name) {
    230244                                optarr[idx].name = options[i].long_name;
     
    256270        {
    257271                int idx = 0;
    258                 for(int i = 0; i < opt_count; i++) {
     272                for(size_t i = 0; i < opt_count; i++) {
    259273                        optstring[idx] = options[i].short_name;
    260274                        idx++;
     
    279293                        case 'h':
    280294                                out = stdout;
     295                                [[fallthrough]];
    281296                        case '?':
    282297                                usage(argv[0], options, opt_count, usage_msg, out);
    283298                        default:
    284                                 for(int i = 0; i < opt_count; i++) {
     299                                for(size_t i = 0; i < opt_count; i++) {
    285300                                        if(opt == options[i].short_name) {
    286301                                                const char * arg = optarg ? optarg : "";
     302                                                if( arg[0] == '=' ) { arg++; }
    287303                                                bool success = options[i].parse_fun( arg, options[i].variable );
    288304                                                if(success) goto NEXT_ARG;
     
    319335        int width = 0;
    320336        {
    321                 for(int i = 0; i < opt_count; i++) {
     337                for(size_t i = 0; i < opt_count; i++) {
    322338                        if(options[i].long_name) {
    323339                                int w = strlen(options[i].long_name);
     
    338354        fprintf(out, "Usage:\n  %s %s\n", cmd, help);
    339355
    340         for(int i = 0; i < opt_count; i++) {
     356        for(size_t i = 0; i < opt_count; i++) {
    341357                printopt(out, width, max_width, options[i].short_name, options[i].long_name, options[i].help);
    342358        }
Note: See TracChangeset for help on using the changeset viewer.