Ignore:
Timestamp:
Jul 17, 2020, 3:46:14 PM (16 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
2ecbd7b, e93cbfa
Parents:
680ae0e (diff), 53e4562 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/parseargs.cfa

    r680ae0e r0d52c6f  
    1212
    1313        extern int fprintf ( FILE * stream, const char * format, ... );
    14         extern long long int strtoll (const char* str, char** endptr, int base);
     14
     15        extern          long long int strtoll (const char* str, char** endptr, int base);
     16        extern unsigned long long int strtoull(const char* str, char** endptr, int base);
    1517}
    1618
     
    9496
    9597        USAGE:
    96         fprintf(out, "%s\n", usage);
     98        fprintf(out, "Usage:\n  %s %s\n", argv[0], usage);
    9799
    98100        for(i; opt_count) {
     
    132134}
    133135
     136bool parse(const char * arg, unsigned & value) {
     137        char * end;
     138        unsigned long long int r = strtoull(arg, &end, 10);
     139        if(*end != '\0') return false;
     140#warning not checking max
     141
     142        value = r;
     143        return true;
     144}
     145
     146bool parse(const char * arg, size_t & value) {
     147        char * end;
     148        unsigned long long int r = strtoull(arg, &end, 10);
     149        if(*end != '\0') return false;
     150#warning not checking max
     151
     152        value = r;
     153        return true;
     154}
     155
    134156bool parse(const char * arg, int & value) {
    135157        char * end;
Note: See TracChangeset for help on using the changeset viewer.