|
1 /* |
|
2 ****************************************************************************** |
|
3 * |
|
4 * Copyright (C) 1997-2001, International Business Machines |
|
5 * Corporation and others. All Rights Reserved. |
|
6 * |
|
7 ****************************************************************************** |
|
8 * file name: cpputils.h |
|
9 * encoding: US-ASCII |
|
10 * tab size: 8 (not used) |
|
11 * indentation:4 |
|
12 */ |
|
13 |
|
14 #ifndef CPPUTILS_H |
|
15 #define CPPUTILS_H |
|
16 |
|
17 #include "unicode/utypes.h" |
|
18 #include "cmemory.h" |
|
19 |
|
20 /*==========================================================================*/ |
|
21 /* Array copy utility functions */ |
|
22 /*==========================================================================*/ |
|
23 |
|
24 static |
|
25 inline void uprv_arrayCopy(const double* src, double* dst, int32_t count) |
|
26 { uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); } |
|
27 |
|
28 static |
|
29 inline void uprv_arrayCopy(const double* src, int32_t srcStart, |
|
30 double* dst, int32_t dstStart, int32_t count) |
|
31 { uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } |
|
32 |
|
33 static |
|
34 inline void uprv_arrayCopy(const int8_t* src, int8_t* dst, int32_t count) |
|
35 { uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); } |
|
36 |
|
37 static |
|
38 inline void uprv_arrayCopy(const int8_t* src, int32_t srcStart, |
|
39 int8_t* dst, int32_t dstStart, int32_t count) |
|
40 { uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } |
|
41 |
|
42 static |
|
43 inline void uprv_arrayCopy(const int16_t* src, int16_t* dst, int32_t count) |
|
44 { uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); } |
|
45 |
|
46 static |
|
47 inline void uprv_arrayCopy(const int16_t* src, int32_t srcStart, |
|
48 int16_t* dst, int32_t dstStart, int32_t count) |
|
49 { uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } |
|
50 |
|
51 static |
|
52 inline void uprv_arrayCopy(const int32_t* src, int32_t* dst, int32_t count) |
|
53 { uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); } |
|
54 |
|
55 static |
|
56 inline void uprv_arrayCopy(const int32_t* src, int32_t srcStart, |
|
57 int32_t* dst, int32_t dstStart, int32_t count) |
|
58 { uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } |
|
59 |
|
60 static |
|
61 inline void |
|
62 uprv_arrayCopy(const UChar *src, int32_t srcStart, |
|
63 UChar *dst, int32_t dstStart, int32_t count) |
|
64 { uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } |
|
65 |
|
66 #endif /* _CPPUTILS */ |