]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/cpputils.h
ICU-6.2.22.tar.gz
[apple/icu.git] / icuSources / common / cpputils.h
CommitLineData
b75a7d8f
A
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
24static
25inline void uprv_arrayCopy(const double* src, double* dst, int32_t count)
26{ uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
27
28static
29inline 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
33static
34inline void uprv_arrayCopy(const int8_t* src, int8_t* dst, int32_t count)
35 { uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
36
37static
38inline 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
42static
43inline void uprv_arrayCopy(const int16_t* src, int16_t* dst, int32_t count)
44{ uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
45
46static
47inline 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
51static
52inline void uprv_arrayCopy(const int32_t* src, int32_t* dst, int32_t count)
53{ uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
54
55static
56inline 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
60static
61inline void
62uprv_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 */