Ignore:
Timestamp:
Aug 15, 2020, 12:03:20 AM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ef9988b
Parents:
74807be (diff), fb0ae06 (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 'new-ast' of plg.uwaterloo.ca:software/cfa/cfa-cc into new-ast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/parseargs.cfa

    r74807be r4fe6224  
    2424#include "limits.hfa"
    2525
     26extern int cfa_args_argc;
     27extern char ** cfa_args_argv;
     28extern char ** cfa_args_envp;
     29
    2630void printopt(FILE * out, int width, int max, char sn, const char * ln, const char * help) {
    2731        int hwidth = max - (11 + width);
     
    3438                fprintf(out, "%*s%.*s\n", width + 11, "", hwidth, help);
    3539        }
     40}
     41
     42void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ) {
     43        parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left );
    3644}
    3745
     
    172180}
    173181
    174 bool parse(const char * arg, size_t & value) {
     182bool parse(const char * arg, unsigned long & value) {
    175183        char * end;
    176184        unsigned long long int r = strtoull(arg, &end, 10);
    177185        if(*end != '\0') return false;
    178         if(r > (size_t)MAX) return false;
     186        if(r > (unsigned long)MAX) return false;
    179187
    180188        value = r;
    181189        return true;
     190}
     191
     192bool parse(const char * arg, unsigned long long & value) {
     193        char * end;
     194        unsigned long long int r = strtoull(arg, &end, 10);
     195        if(*end != '\0') return false;
     196        if(r > (unsigned long long)MAX) return false;
     197
     198        value = r;
     199        return true;
    182200}
    183201
Note: See TracChangeset for help on using the changeset viewer.