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

Side by Side Diff: webrtc/modules/audio_device/win/audio_mixer_manager_win.cc

Issue 1593713013: Roll chromium_revision 7a4fb8d..f527e86 (370025:370073) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix/disable Win Clang warnings Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 2702
2703 // ---------------------------------------------------------------------------- 2703 // ----------------------------------------------------------------------------
2704 // WideToUTF8 2704 // WideToUTF8
2705 // ---------------------------------------------------------------------------- 2705 // ----------------------------------------------------------------------------
2706 2706
2707 char* AudioMixerManager::WideToUTF8(const TCHAR* src) const { 2707 char* AudioMixerManager::WideToUTF8(const TCHAR* src) const {
2708 #ifdef UNICODE 2708 #ifdef UNICODE
2709 const size_t kStrLen = sizeof(_str); 2709 const size_t kStrLen = sizeof(_str);
2710 memset(_str, 0, kStrLen); 2710 memset(_str, 0, kStrLen);
2711 // Get required size (in bytes) to be able to complete the conversion. 2711 // Get required size (in bytes) to be able to complete the conversion.
2712 int required_size = WideCharToMultiByte(CP_UTF8, 0, src, -1, _str, 0, 0, 0); 2712 unsigned int required_size = (unsigned int)WideCharToMultiByte(CP_UTF8, 0, s rc, -1, _str, 0, 0, 0);
2713 if (required_size <= kStrLen) 2713 if (required_size <= kStrLen)
2714 { 2714 {
2715 // Process the entire input string, including the terminating null char. 2715 // Process the entire input string, including the terminating null char.
2716 if (WideCharToMultiByte(CP_UTF8, 0, src, -1, _str, kStrLen, 0, 0) == 0) 2716 if (WideCharToMultiByte(CP_UTF8, 0, src, -1, _str, kStrLen, 0, 0) == 0)
2717 memset(_str, 0, kStrLen); 2717 memset(_str, 0, kStrLen);
2718 } 2718 }
2719 return _str; 2719 return _str;
2720 #else 2720 #else
2721 return const_cast<char*>(src); 2721 return const_cast<char*>(src);
2722 #endif 2722 #endif
2723 } 2723 }
2724 2724
2725 } // namespace webrtc 2725 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698