| 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 thunks """ | 6 """ Generator for C++ style thunks """ |
| 7 | 7 |
| 8 import glob | 8 import glob |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 def _GetDefaultFailureValue(t): | 137 def _GetDefaultFailureValue(t): |
| 138 """Returns the default failure value for a given type. | 138 """Returns the default failure value for a given type. |
| 139 | 139 |
| 140 Returns None if no default failure value exists for the type. | 140 Returns None if no default failure value exists for the type. |
| 141 """ | 141 """ |
| 142 values = { | 142 values = { |
| 143 'PP_Bool': 'PP_FALSE', | 143 'PP_Bool': 'PP_FALSE', |
| 144 'PP_Resource': '0', | 144 'PP_Resource': '0', |
| 145 'struct PP_Var': 'PP_MakeUndefined()', | 145 'struct PP_Var': 'PP_MakeUndefined()', |
| 146 'float': '0.0f', |
| 146 'int32_t': 'enter.retval()', | 147 'int32_t': 'enter.retval()', |
| 147 'uint16_t': '0', | 148 'uint16_t': '0', |
| 148 'uint32_t': '0', | 149 'uint32_t': '0', |
| 149 'uint64_t': '0', | 150 'uint64_t': '0', |
| 150 } | 151 } |
| 151 if t in values: | 152 if t in values: |
| 152 return values[t] | 153 return values[t] |
| 153 return None | 154 return None |
| 154 | 155 |
| 155 | 156 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 print "Golden file for M13-M14 failed." | 434 print "Golden file for M13-M14 failed." |
| 434 failed = 1 | 435 failed = 1 |
| 435 else: | 436 else: |
| 436 print "Golden file for M13-M14 passed." | 437 print "Golden file for M13-M14 passed." |
| 437 | 438 |
| 438 return failed | 439 return failed |
| 439 | 440 |
| 440 | 441 |
| 441 if __name__ == '__main__': | 442 if __name__ == '__main__': |
| 442 sys.exit(Main(sys.argv[1:])) | 443 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |