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

Side by Side Diff: device/usb/tools/usb_ids.py

Issue 1542163002: Switch to standard integer types in device/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win Created 5 years 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 | « device/usb/mock_usb_device_handle.h ('k') | device/usb/usb_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 import itertools 5 import itertools
6 import optparse 6 import optparse
7 import re 7 import re
8 8
9 VENDOR_PATTERN = re.compile("^(?P<id>[0-9a-fA-F]{4})\s+(?P<name>.+)$") 9 VENDOR_PATTERN = re.compile("^(?P<id>[0-9a-fA-F]{4})\s+(?P<name>.+)$")
10 PRODUCT_PATTERN = re.compile("^\t(?P<id>[0-9a-fA-F]{4})\s+(?P<name>.+)$") 10 PRODUCT_PATTERN = re.compile("^\t(?P<id>[0-9a-fA-F]{4})\s+(?P<name>.+)$")
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 parser.add_option("-i", "--input", help="Path to usb.ids") 84 parser.add_option("-i", "--input", help="Path to usb.ids")
85 parser.add_option("-o", "--output", help="Output file path") 85 parser.add_option("-o", "--output", help="Output file path")
86 86
87 (opts, args) = parser.parse_args() 87 (opts, args) = parser.parse_args()
88 table = ParseTable(opts.input) 88 table = ParseTable(opts.input)
89 89
90 output = """// Generated from %s 90 output = """// Generated from %s
91 #ifndef GENERATED_USB_IDS_H_ 91 #ifndef GENERATED_USB_IDS_H_
92 #define GENERATED_USB_IDS_H_ 92 #define GENERATED_USB_IDS_H_
93 93
94 #include <stddef.h>
95
94 #include "device/usb/usb_ids.h" 96 #include "device/usb/usb_ids.h"
95 97
96 namespace device { 98 namespace device {
97 99
98 """ % (opts.input) 100 """ % (opts.input)
99 output += GenerateDeviceDefinitions(table) 101 output += GenerateDeviceDefinitions(table)
100 output += GenerateVendorDefinitions(table) 102 output += GenerateVendorDefinitions(table)
101 output += """ 103 output += """
102 104
103 } // namespace device 105 } // namespace device
104 106
105 #endif // GENERATED_USB_IDS_H_ 107 #endif // GENERATED_USB_IDS_H_
106 """ 108 """
107 109
108 output_file = open(opts.output, "w+") 110 output_file = open(opts.output, "w+")
109 output_file.write(output) 111 output_file.write(output)
110 output_file.close() 112 output_file.close()
OLDNEW
« no previous file with comments | « device/usb/mock_usb_device_handle.h ('k') | device/usb/usb_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698