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

Side by Side Diff: ppapi/shared_impl/ppb_gamepad_shared.cc

Issue 1548813002: Switch to standard integer types in ppapi/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 12 months 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 | « ppapi/shared_impl/ppb_gamepad_shared.h ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.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 #include "ppapi/shared_impl/ppb_gamepad_shared.h" 5 #include "ppapi/shared_impl/ppb_gamepad_shared.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h"
10 9
11 namespace ppapi { 10 namespace ppapi {
12 11
13 const size_t WebKitGamepads::kItemsLengthCap; 12 const size_t WebKitGamepads::kItemsLengthCap;
14 13
15 void ConvertWebKitGamepadData(const WebKitGamepads& webkit_data, 14 void ConvertWebKitGamepadData(const WebKitGamepads& webkit_data,
16 PP_GamepadsSampleData* output_data) { 15 PP_GamepadsSampleData* output_data) {
17 size_t length = std::min(WebKitGamepads::kItemsLengthCap, 16 size_t length = std::min(WebKitGamepads::kItemsLengthCap,
18 static_cast<const size_t>(webkit_data.length)); 17 static_cast<const size_t>(webkit_data.length));
19 output_data->length = static_cast<unsigned>(length); 18 output_data->length = static_cast<unsigned>(length);
(...skipping 10 matching lines...) Expand all
30 for (unsigned j = 0; j < webkit_pad.axes_length; ++j) 29 for (unsigned j = 0; j < webkit_pad.axes_length; ++j)
31 output_pad.axes[j] = static_cast<float>(webkit_pad.axes[j]); 30 output_pad.axes[j] = static_cast<float>(webkit_pad.axes[j]);
32 output_pad.buttons_length = webkit_pad.buttons_length; 31 output_pad.buttons_length = webkit_pad.buttons_length;
33 for (unsigned j = 0; j < webkit_pad.buttons_length; ++j) 32 for (unsigned j = 0; j < webkit_pad.buttons_length; ++j)
34 output_pad.buttons[j] = static_cast<float>(webkit_pad.buttons[j].value); 33 output_pad.buttons[j] = static_cast<float>(webkit_pad.buttons[j].value);
35 } 34 }
36 } 35 }
37 } 36 }
38 37
39 } // namespace ppapi 38 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_gamepad_shared.h ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698