Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: lib/cksum/debug.c

Issue 1348403002: Consistently use the STATIC_COMMAND macro every time we define a console command. (Closed) Base URL: https://github.com/travisg/lk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/buildsig/buildsig.c ('k') | lib/debugcommands/debugcommands.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 Travis Geiselbrecht 2 * Copyright (c) 2012 Travis Geiselbrecht
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining 4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files 5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction, 6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge, 7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software, 8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so, 9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions: 10 * subject to the following conditions:
(...skipping 21 matching lines...) Expand all
32 32
33 #include <lib/console.h> 33 #include <lib/console.h>
34 34
35 static int cmd_crc16(int argc, const cmd_args *argv); 35 static int cmd_crc16(int argc, const cmd_args *argv);
36 static int cmd_crc32(int argc, const cmd_args *argv); 36 static int cmd_crc32(int argc, const cmd_args *argv);
37 static int cmd_adler32(int argc, const cmd_args *argv); 37 static int cmd_adler32(int argc, const cmd_args *argv);
38 static int cmd_cksum_bench(int argc, const cmd_args *argv); 38 static int cmd_cksum_bench(int argc, const cmd_args *argv);
39 39
40 STATIC_COMMAND_START 40 STATIC_COMMAND_START
41 #if LK_DEBUGLEVEL > 0 41 #if LK_DEBUGLEVEL > 0
42 » { "crc16", "crc16", &cmd_crc16 }, 42 » STATIC_COMMAND("crc16", "crc16", &cmd_crc16)
43 » { "crc32", "crc32", &cmd_crc32 }, 43 » STATIC_COMMAND("crc32", "crc32", &cmd_crc32)
44 » { "adler32", "adler32", &cmd_adler32 }, 44 » STATIC_COMMAND("adler32", "adler32", &cmd_adler32)
45 #endif 45 #endif
46 #if LK_DEBUGLEVEL > 1 46 #if LK_DEBUGLEVEL > 1
47 » { "bench_cksum", "benchmark the checksum routines", &cmd_cksum_bench }, 47 » STATIC_COMMAND("bench_cksum", "benchmark the checksum routines", &cmd_ck sum_bench)
48 #endif 48 #endif
49 STATIC_COMMAND_END(crc); 49 STATIC_COMMAND_END(crc);
50 50
51 static int cmd_crc16(int argc, const cmd_args *argv) 51 static int cmd_crc16(int argc, const cmd_args *argv)
52 { 52 {
53 if (argc < 3) { 53 if (argc < 3) {
54 printf("not enough arguments\n"); 54 printf("not enough arguments\n");
55 printf("usage: %s <address> <size>\n", argv[0].str); 55 printf("usage: %s <address> <size>\n", argv[0].str);
56 return -1; 56 return -1;
57 } 57 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 printf("took %llu usecs to adler32 %d bytes (%lld bytes/sec)\n", t, BUFS IZE * ITER, (BUFSIZE * ITER) * 1000000ULL / t); 136 printf("took %llu usecs to adler32 %d bytes (%lld bytes/sec)\n", t, BUFS IZE * ITER, (BUFSIZE * ITER) * 1000000ULL / t);
137 137
138 if (freebuf) 138 if (freebuf)
139 free(buf); 139 free(buf);
140 return 0; 140 return 0;
141 } 141 }
142 142
143 #endif // WITH_LIB_CONSOLE 143 #endif // WITH_LIB_CONSOLE
144 144
145 // vim: set noexpandtab: 145 // vim: set noexpandtab:
OLDNEW
« no previous file with comments | « lib/buildsig/buildsig.c ('k') | lib/debugcommands/debugcommands.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698