Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ Generator for C style prototypes and definitions """ | 6 """ Generator for C style prototypes and definitions """ |
| 7 | 7 |
| 8 import glob | 8 import glob |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 if last_group: | 138 if last_group: |
| 139 out.Write(CommentLines(['*',' @}', '']) + '\n') | 139 out.Write(CommentLines(['*',' @}', '']) + '\n') |
| 140 | 140 |
| 141 | 141 |
| 142 def CheckTypedefs(filenode, releases): | 142 def CheckTypedefs(filenode, releases): |
| 143 """Checks that typedefs don't specify callbacks that take some structs. | 143 """Checks that typedefs don't specify callbacks that take some structs. |
| 144 | 144 |
| 145 See http://crbug.com/233439 for details. | 145 See http://crbug.com/233439 for details. |
| 146 """ | 146 """ |
| 147 cgen = CGen() | 147 cgen = CGen() |
| 148 # TODO(teravest): Fix the following callback to pass PP_Var by pointer | 148 # TODO(yzshen): (1) remove PP_Ext_Alarms_OnAlarm_Func_Dev_0_1 and the |
| 149 # instead of by value. | 149 # corresponding whitelist entry; (2) fix this check -- it should be okay for |
| 150 node_whitelist = ['PP_Ext_Alarms_OnAlarm_Func_Dev_0_1'] | 150 # PP_Alarms_OnAlarm_Dev to pass a struct pointer. |
|
dmichael (off chromium)
2013/12/06 17:44:07
Have you checked with teravest or somebody on PNaC
yzshen1
2013/12/06 21:38:21
I could add Justin as a reviewer.
This check was a
| |
| 151 node_whitelist = ['PP_Ext_Alarms_OnAlarm_Func_Dev_0_1', | |
| 152 'PP_Alarms_OnAlarm_Dev'] | |
| 151 for node in filenode.GetListOf('Typedef'): | 153 for node in filenode.GetListOf('Typedef'): |
| 152 if node.GetName() in node_whitelist: | 154 if node.GetName() in node_whitelist: |
| 153 continue | 155 continue |
| 154 build_list = node.GetUniqueReleases(releases) | 156 build_list = node.GetUniqueReleases(releases) |
| 155 callnode = node.GetOneOf('Callspec') | 157 callnode = node.GetOneOf('Callspec') |
| 156 if callnode: | 158 if callnode: |
| 157 for param in callnode.GetListOf('Param'): | 159 for param in callnode.GetListOf('Param'): |
| 158 if param.GetListOf('Array'): | 160 if param.GetListOf('Array'): |
| 159 continue | 161 continue |
| 160 if cgen.GetParamMode(param) != 'in': | 162 if cgen.GetParamMode(param) != 'in': |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 print "Golden file for M13-M15 failed." | 348 print "Golden file for M13-M15 failed." |
| 347 failed =1 | 349 failed =1 |
| 348 else: | 350 else: |
| 349 print "Golden file for M13-M15 passed." | 351 print "Golden file for M13-M15 passed." |
| 350 | 352 |
| 351 return failed | 353 return failed |
| 352 | 354 |
| 353 if __name__ == '__main__': | 355 if __name__ == '__main__': |
| 354 sys.exit(main(sys.argv[1:])) | 356 sys.exit(main(sys.argv[1:])) |
| 355 | 357 |
| OLD | NEW |