OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 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 "SkTypes.h" | 10 #include "SkTypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 int32_t SkToS32(intmax_t x) { | 34 int32_t SkToS32(intmax_t x) { |
35 SkASSERT((int32_t)x == x); | 35 SkASSERT((int32_t)x == x); |
36 return (int32_t)x; | 36 return (int32_t)x; |
37 } | 37 } |
38 | 38 |
39 uint32_t SkToU32(uintmax_t x) { | 39 uint32_t SkToU32(uintmax_t x) { |
40 SkASSERT((uint32_t)x == x); | 40 SkASSERT((uint32_t)x == x); |
41 return (uint32_t)x; | 41 return (uint32_t)x; |
42 } | 42 } |
43 | 43 |
| 44 int SkToInt(intmax_t x) { |
| 45 SkASSERT((int)x == x); |
| 46 return (int)x; |
| 47 } |
| 48 |
44 #endif | 49 #endif |
OLD | NEW |