Changeset 56e8cb3


Ignore:
Timestamp:
Aug 11, 2020, 6:33:56 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a5428bd
Parents:
129674b
Message:

Fixed parseargs for 32bit

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/parseargs.cfa

    r129674b r56e8cb3  
    172172}
    173173
    174 bool parse(const char * arg, size_t & value) {
     174bool parse(const char * arg, unsigned long & value) {
    175175        char * end;
    176176        unsigned long long int r = strtoull(arg, &end, 10);
    177177        if(*end != '\0') return false;
    178         if(r > (size_t)MAX) return false;
     178        if(r > (unsigned long)MAX) return false;
    179179
    180180        value = r;
    181181        return true;
     182}
     183
     184bool parse(const char * arg, unsigned long long & value) {
     185        char * end;
     186        unsigned long long int r = strtoull(arg, &end, 10);
     187        if(*end != '\0') return false;
     188        if(r > (unsigned long long)MAX) return false;
     189
     190        value = r;
     191        return true;
    182192}
    183193
  • libcfa/src/parseargs.hfa

    r129674b r56e8cb3  
    3939bool parse(const char *, const char * & );
    4040bool parse(const char *, unsigned & );
    41 bool parse(const char *, size_t & );
     41bool parse(const char *, unsigned long & );
     42bool parse(const char *, unsigned long long & );
    4243bool parse(const char *, int & );
Note: See TracChangeset for help on using the changeset viewer.