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 "device/usb/usb_descriptors.h" | 5 #include "device/usb/usb_descriptors.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 | 10 |
9 namespace device { | 11 namespace device { |
10 | 12 |
11 namespace { | 13 namespace { |
12 const uint8_t kStringDescriptorType = 0x03; | 14 const uint8_t kStringDescriptorType = 0x03; |
13 } | 15 } |
14 | 16 |
15 UsbEndpointDescriptor::UsbEndpointDescriptor() | 17 UsbEndpointDescriptor::UsbEndpointDescriptor() |
16 : address(0), | 18 : address(0), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Special case to avoid indexing beyond the end of |descriptor|. | 63 // Special case to avoid indexing beyond the end of |descriptor|. |
62 *output = base::string16(); | 64 *output = base::string16(); |
63 } else { | 65 } else { |
64 *output = base::string16( | 66 *output = base::string16( |
65 reinterpret_cast<const base::char16*>(&descriptor[2]), length / 2 - 1); | 67 reinterpret_cast<const base::char16*>(&descriptor[2]), length / 2 - 1); |
66 } | 68 } |
67 return true; | 69 return true; |
68 } | 70 } |
69 | 71 |
70 } // namespace device | 72 } // namespace device |
OLD | NEW |