Changeset 0d52c6f for benchmark/io/http/parseargs.cfa
- Timestamp:
- Jul 17, 2020, 3:46:14 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/parseargs.cfa
r680ae0e r0d52c6f 12 12 13 13 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); 15 17 } 16 18 … … 94 96 95 97 USAGE: 96 fprintf(out, " %s\n", usage);98 fprintf(out, "Usage:\n %s %s\n", argv[0], usage); 97 99 98 100 for(i; opt_count) { … … 132 134 } 133 135 136 bool 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 146 bool 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 134 156 bool parse(const char * arg, int & value) { 135 157 char * end;
Note: See TracChangeset
for help on using the changeset viewer.