Changeset 713ba400 in mainline
- Timestamp:
- 2019-01-01T19:53:07Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 858469f
- Parents:
- 32236e5
- Location:
- uspace/app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/perf/perf.c
r32236e5 r713ba400 35 35 */ 36 36 37 #include <assert.h> 37 38 #include <stdio.h> 38 39 #include <stddef.h> … … 42 43 #include <errno.h> 43 44 #include <perf.h> 45 #include <types/casting.h> 44 46 #include "perf.h" 45 47 #include "benchlist.h" … … 226 228 } 227 229 228 unsigned int _len = (unsigned int) len; 229 if ((_len != len) || (((int) _len) < 0)) { 230 printf("Command length overflow\n"); 231 return; 232 } 230 assert(can_cast_size_t_to_int(len) && "benchmark name length overflow"); 233 231 234 232 for (size_t i = 0; i < benchmark_count; i++) 235 printf("%-*s %s\n", _len, benchmarks[i]->name, benchmarks[i]->desc);236 237 printf("%-*s Run all benchmarks\n", _len, "*");233 printf("%-*s %s\n", (int) len, benchmarks[i]->name, benchmarks[i]->desc); 234 235 printf("%-*s Run all benchmarks\n", (int) len, "*"); 238 236 } 239 237 -
uspace/app/tester/tester.c
r32236e5 r713ba400 35 35 */ 36 36 37 #include <assert.h> 37 38 #include <stdio.h> 38 39 #include <stddef.h> … … 40 41 #include <str.h> 41 42 #include <io/log.h> 43 #include <types/casting.h> 42 44 #include "tester.h" 43 45 … … 144 146 } 145 147 146 unsigned int _len = (unsigned int) len; 147 if ((_len != len) || (((int) _len) < 0)) { 148 printf("Command length overflow\n"); 149 return; 150 } 148 assert(can_cast_size_t_to_int(len) && "test name length overflow"); 151 149 152 150 for (test = tests; test->name != NULL; test++) 153 printf("%-*s %s%s\n", _len, test->name, test->desc,151 printf("%-*s %s%s\n", (int) len, test->name, test->desc, 154 152 (test->safe ? "" : " (unsafe)")); 155 153 156 printf("%-*s Run all safe tests\n", _len, "*");154 printf("%-*s Run all safe tests\n", (int) len, "*"); 157 155 } 158 156
Note:
See TracChangeset
for help on using the changeset viewer.