os/textandloc/fontservices/textshaperplugin/IcuSource/common/cpputils.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/common/cpputils.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,66 @@
     1.4 +/*
     1.5 +******************************************************************************
     1.6 +*
     1.7 +*   Copyright (C) 1997-2001, International Business Machines
     1.8 +*   Corporation and others.  All Rights Reserved.
     1.9 +*
    1.10 +******************************************************************************
    1.11 +*   file name:  cpputils.h
    1.12 +*   encoding:   US-ASCII
    1.13 +*   tab size:   8 (not used)
    1.14 +*   indentation:4
    1.15 +*/
    1.16 +
    1.17 +#ifndef CPPUTILS_H
    1.18 +#define CPPUTILS_H
    1.19 +
    1.20 +#include "unicode/utypes.h"
    1.21 +#include "cmemory.h"
    1.22 +
    1.23 +/*==========================================================================*/
    1.24 +/* Array copy utility functions */
    1.25 +/*==========================================================================*/
    1.26 +
    1.27 +static
    1.28 +inline void uprv_arrayCopy(const double* src, double* dst, int32_t count)
    1.29 +{ uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
    1.30 +
    1.31 +static
    1.32 +inline void uprv_arrayCopy(const double* src, int32_t srcStart,
    1.33 +              double* dst, int32_t dstStart, int32_t count)
    1.34 +{ uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); }
    1.35 +
    1.36 +static
    1.37 +inline void uprv_arrayCopy(const int8_t* src, int8_t* dst, int32_t count)
    1.38 +    { uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
    1.39 +
    1.40 +static
    1.41 +inline void uprv_arrayCopy(const int8_t* src, int32_t srcStart,
    1.42 +              int8_t* dst, int32_t dstStart, int32_t count)
    1.43 +{ uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); }
    1.44 +
    1.45 +static
    1.46 +inline void uprv_arrayCopy(const int16_t* src, int16_t* dst, int32_t count)
    1.47 +{ uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
    1.48 +
    1.49 +static
    1.50 +inline void uprv_arrayCopy(const int16_t* src, int32_t srcStart,
    1.51 +              int16_t* dst, int32_t dstStart, int32_t count)
    1.52 +{ uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); }
    1.53 +
    1.54 +static
    1.55 +inline void uprv_arrayCopy(const int32_t* src, int32_t* dst, int32_t count)
    1.56 +{ uprv_memcpy(dst, src, (size_t)(count * sizeof(*src))); }
    1.57 +
    1.58 +static
    1.59 +inline void uprv_arrayCopy(const int32_t* src, int32_t srcStart,
    1.60 +              int32_t* dst, int32_t dstStart, int32_t count)
    1.61 +{ uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); }
    1.62 +
    1.63 +static
    1.64 +inline void
    1.65 +uprv_arrayCopy(const UChar *src, int32_t srcStart,
    1.66 +        UChar *dst, int32_t dstStart, int32_t count)
    1.67 +{ uprv_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); }
    1.68 +
    1.69 +#endif /* _CPPUTILS */