1 :
2 : /*
3 : * Copyright 2006 The Android Open Source Project
4 : *
5 : * Use of this source code is governed by a BSD-style license that can be
6 : * found in the LICENSE file.
7 : */
8 :
9 :
10 : #include "SkTypes.h"
11 :
12 : #ifdef SK_DEBUG
13 :
14 0 : int8_t SkToS8(long x)
15 : {
16 0 : SkASSERT((int8_t)x == x);
17 0 : return (int8_t)x;
18 : }
19 :
20 0 : uint8_t SkToU8(size_t x)
21 : {
22 0 : SkASSERT((uint8_t)x == x);
23 0 : return (uint8_t)x;
24 : }
25 :
26 0 : int16_t SkToS16(long x)
27 : {
28 0 : SkASSERT((int16_t)x == x);
29 0 : return (int16_t)x;
30 : }
31 :
32 0 : uint16_t SkToU16(size_t x)
33 : {
34 0 : SkASSERT((uint16_t)x == x);
35 0 : return (uint16_t)x;
36 : }
37 :
38 0 : int32_t SkToS32(long x)
39 : {
40 : SkASSERT((int32_t)x == x);
41 0 : return (int32_t)x;
42 : }
43 :
44 0 : uint32_t SkToU32(size_t x)
45 : {
46 : SkASSERT((uint32_t)x == x);
47 0 : return (uint32_t)x;
48 : }
49 :
50 : #endif
51 :
|