OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 #include <iostream> | 6 #include <iostream> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Redefine macros to generate table | 27 // Redefine macros to generate table |
28 #include "ipc/ipc_message_null_macros.h" | 28 #include "ipc/ipc_message_null_macros.h" |
29 #undef IPC_MESSAGE_DECL | 29 #undef IPC_MESSAGE_DECL |
30 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ | 30 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ |
31 { #name, __FILE__, IPC_MESSAGE_ID(), in, out }, | 31 { #name, __FILE__, IPC_MESSAGE_ID(), in, out }, |
32 | 32 |
33 static msginfo msgtable[] = { | 33 static msginfo msgtable[] = { |
34 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 34 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
35 }; | 35 }; |
36 #define MSGTABLE_SIZE (sizeof(msgtable)/sizeof(msgtable[0])) | 36 #define MSGTABLE_SIZE (sizeof(msgtable)/sizeof(msgtable[0])) |
37 COMPILE_ASSERT(MSGTABLE_SIZE, CHECK_YOUR_HEADERS_FOR_AN_EXTRA_SEMICOLON); | 37 static_assert(MSGTABLE_SIZE, "check your headers for an extra semicolon"); |
38 | 38 |
39 static bool check_msgtable() { | 39 static bool check_msgtable() { |
40 bool result = true; | 40 bool result = true; |
41 int previous_class_id = 0; | 41 int previous_class_id = 0; |
42 int highest_class_id = 0; | 42 int highest_class_id = 0; |
43 const char* file_name = "NONE"; | 43 const char* file_name = "NONE"; |
44 const char* previous_file_name = "NONE"; | 44 const char* previous_file_name = "NONE"; |
45 std::vector<int> exemptions; | 45 std::vector<int> exemptions; |
46 | 46 |
47 // Exclude test and other non-browser files from consideration. Do not | 47 // Exclude test and other non-browser files from consideration. Do not |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 std::sort(msgtable, msgtable + MSGTABLE_SIZE); | 172 std::sort(msgtable, msgtable + MSGTABLE_SIZE); |
173 | 173 |
174 if (!skip_check && check_msgtable() == false) | 174 if (!skip_check && check_msgtable() == false) |
175 return 1; | 175 return 1; |
176 | 176 |
177 dump_msgtable(show_args, show_ids, show_comma, filter); | 177 dump_msgtable(show_args, show_ids, show_comma, filter); |
178 return 0; | 178 return 0; |
179 } | 179 } |
180 | 180 |
OLD | NEW |