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

Side by Side Diff: webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc

Issue 1510233002: clang/win: Fix -Wextra warnings in webrtc. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: debug 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 | « webrtc/base/systeminfo.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 BOOL ScreenCapturerWinMagnifier::OnMagImageScalingCallback( 230 BOOL ScreenCapturerWinMagnifier::OnMagImageScalingCallback(
231 HWND hwnd, 231 HWND hwnd,
232 void* srcdata, 232 void* srcdata,
233 MAGIMAGEHEADER srcheader, 233 MAGIMAGEHEADER srcheader,
234 void* destdata, 234 void* destdata,
235 MAGIMAGEHEADER destheader, 235 MAGIMAGEHEADER destheader,
236 RECT unclipped, 236 RECT unclipped,
237 RECT clipped, 237 RECT clipped,
238 HRGN dirty) { 238 HRGN dirty) {
239 assert(tls_index_.Value() != TLS_OUT_OF_INDEXES); 239 assert(tls_index_.Value() != static_cast<int32_t>(TLS_OUT_OF_INDEXES));
Sergey Ulanov 2015/12/09 20:50:42 maybe define kTlsIndexNotSet instead of using TLS_
Nico 2015/12/09 21:11:26 done
240 240
241 ScreenCapturerWinMagnifier* owner = 241 ScreenCapturerWinMagnifier* owner =
242 reinterpret_cast<ScreenCapturerWinMagnifier*>( 242 reinterpret_cast<ScreenCapturerWinMagnifier*>(
243 TlsGetValue(tls_index_.Value())); 243 TlsGetValue(tls_index_.Value()));
244 244
245 owner->OnCaptured(srcdata, srcheader); 245 owner->OnCaptured(srcdata, srcheader);
246 246
247 return TRUE; 247 return TRUE;
248 } 248 }
249 249
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 magnifier_window_, MW_FILTERMODE_EXCLUDE, 1, &excluded_window_); 362 magnifier_window_, MW_FILTERMODE_EXCLUDE, 1, &excluded_window_);
363 if (!result) { 363 if (!result) {
364 mag_uninitialize_func_(); 364 mag_uninitialize_func_();
365 LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " 365 LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
366 << "error from MagSetWindowFilterList " 366 << "error from MagSetWindowFilterList "
367 << GetLastError(); 367 << GetLastError();
368 return false; 368 return false;
369 } 369 }
370 } 370 }
371 371
372 if (tls_index_.Value() == TLS_OUT_OF_INDEXES) { 372 if (tls_index_.Value() == static_cast<int32_t>(TLS_OUT_OF_INDEXES)) {
373 // More than one threads may get here at the same time, but only one will 373 // More than one threads may get here at the same time, but only one will
374 // write to tls_index_ using CompareExchange. 374 // write to tls_index_ using CompareExchange.
375 DWORD new_tls_index = TlsAlloc(); 375 DWORD new_tls_index = TlsAlloc();
376 if (!tls_index_.CompareExchange(new_tls_index, TLS_OUT_OF_INDEXES)) 376 if (!tls_index_.CompareExchange(new_tls_index, TLS_OUT_OF_INDEXES))
377 TlsFree(new_tls_index); 377 TlsFree(new_tls_index);
378 } 378 }
379 379
380 assert(tls_index_.Value() != TLS_OUT_OF_INDEXES); 380 assert(tls_index_.Value() != static_cast<int32_t>(TLS_OUT_OF_INDEXES));
381 TlsSetValue(tls_index_.Value(), this); 381 TlsSetValue(tls_index_.Value(), this);
382 382
383 magnifier_initialized_ = true; 383 magnifier_initialized_ = true;
384 return true; 384 return true;
385 } 385 }
386 386
387 void ScreenCapturerWinMagnifier::OnCaptured(void* data, 387 void ScreenCapturerWinMagnifier::OnCaptured(void* data,
388 const MAGIMAGEHEADER& header) { 388 const MAGIMAGEHEADER& header) {
389 DesktopFrame* current_frame = queue_.current_frame(); 389 DesktopFrame* current_frame = queue_.current_frame();
390 390
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 assert(fallback_capturer_); 440 assert(fallback_capturer_);
441 if (!fallback_capturer_started_) { 441 if (!fallback_capturer_started_) {
442 fallback_capturer_started_ = true; 442 fallback_capturer_started_ = true;
443 443
444 fallback_capturer_->Start(callback_); 444 fallback_capturer_->Start(callback_);
445 fallback_capturer_->SelectScreen(current_screen_id_); 445 fallback_capturer_->SelectScreen(current_screen_id_);
446 } 446 }
447 } 447 }
448 448
449 } // namespace webrtc 449 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/base/systeminfo.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698