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

Side by Side Diff: device/hid/hid_report_descriptor.cc

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/hid/hid_report_descriptor.h ('k') | device/hid/hid_report_descriptor_item.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 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/hid/hid_report_descriptor.h" 5 #include "device/hid/hid_report_descriptor.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 8
9 namespace device { 9 namespace device {
10 10
11 namespace { 11 namespace {
12 12
13 const int kBitsPerByte = 8; 13 const int kBitsPerByte = 8;
14 14
15 } // namespace 15 } // namespace
16 16
17 HidReportDescriptor::HidReportDescriptor(const std::vector<uint8>& bytes) { 17 HidReportDescriptor::HidReportDescriptor(const std::vector<uint8_t>& bytes) {
18 size_t header_index = 0; 18 size_t header_index = 0;
19 HidReportDescriptorItem* item = NULL; 19 HidReportDescriptorItem* item = NULL;
20 while (header_index < bytes.size()) { 20 while (header_index < bytes.size()) {
21 item = new HidReportDescriptorItem(&bytes[header_index], item); 21 item = new HidReportDescriptorItem(&bytes[header_index], item);
22 items_.push_back(linked_ptr<HidReportDescriptorItem>(item)); 22 items_.push_back(linked_ptr<HidReportDescriptorItem>(item));
23 header_index += item->GetSize(); 23 header_index += item->GetSize();
24 } 24 }
25 } 25 }
26 26
27 HidReportDescriptor::~HidReportDescriptor() {} 27 HidReportDescriptor::~HidReportDescriptor() {}
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 *max_feature_report_size = 150 *max_feature_report_size =
151 std::max(*max_feature_report_size, current_feature_report_size); 151 std::max(*max_feature_report_size, current_feature_report_size);
152 152
153 // Convert bits into bytes 153 // Convert bits into bytes
154 *max_input_report_size /= kBitsPerByte; 154 *max_input_report_size /= kBitsPerByte;
155 *max_output_report_size /= kBitsPerByte; 155 *max_output_report_size /= kBitsPerByte;
156 *max_feature_report_size /= kBitsPerByte; 156 *max_feature_report_size /= kBitsPerByte;
157 } 157 }
158 158
159 } // namespace device 159 } // namespace device
OLDNEW
« no previous file with comments | « device/hid/hid_report_descriptor.h ('k') | device/hid/hid_report_descriptor_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698