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

Side by Side Diff: src/ports/SkThread_win.cpp

Issue 17047004: Fixed invalid cast on mingw. (Closed)
Patch Set: Created 7 years, 6 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 | « no previous file | 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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 18 matching lines...) Expand all
29 static_cast<LONG>(inc)); 29 static_cast<LONG>(inc));
30 } 30 }
31 31
32 int32_t sk_atomic_dec(int32_t* addr) { 32 int32_t sk_atomic_dec(int32_t* addr) {
33 return _InterlockedDecrement(reinterpret_cast<LONG*>(addr)) + 1; 33 return _InterlockedDecrement(reinterpret_cast<LONG*>(addr)) + 1;
34 } 34 }
35 void sk_membar_aquire__after_atomic_dec() { } 35 void sk_membar_aquire__after_atomic_dec() { }
36 36
37 int32_t sk_atomic_conditional_inc(int32_t* addr) { 37 int32_t sk_atomic_conditional_inc(int32_t* addr) {
38 while (true) { 38 while (true) {
39 LONG value = static_cast<LONG const volatile&>(*addr); 39 LONG value = static_cast<int32_t const volatile&>(*addr);
40 if (value == 0) { 40 if (value == 0) {
41 return 0; 41 return 0;
42 } 42 }
43 if (_InterlockedCompareExchange(reinterpret_cast<LONG*>(addr), 43 if (_InterlockedCompareExchange(reinterpret_cast<LONG*>(addr),
44 value + 1, 44 value + 1,
45 value) == value) { 45 value) == value) {
46 return value; 46 return value;
47 } 47 }
48 } 48 }
49 } 49 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 #pragma const_seg() 127 #pragma const_seg()
128 128
129 #else 129 #else
130 130
131 #pragma data_seg(".CRT$XLB") 131 #pragma data_seg(".CRT$XLB")
132 PIMAGE_TLS_CALLBACK skia_tls_callback = onTLSCallback; 132 PIMAGE_TLS_CALLBACK skia_tls_callback = onTLSCallback;
133 #pragma data_seg() 133 #pragma data_seg()
134 134
135 #endif 135 #endif
136 } 136 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698