2016-09-25 09:24:03 +02:00
|
|
|
@@
|
2022-07-10 12:05:51 +02:00
|
|
|
type T;
|
|
|
|
T *dst_ptr;
|
|
|
|
T *src_ptr;
|
|
|
|
expression n;
|
2016-09-25 09:24:03 +02:00
|
|
|
@@
|
2022-07-10 12:05:51 +02:00
|
|
|
- memcpy(dst_ptr, src_ptr, (n) * \( sizeof(T)
|
|
|
|
- \| sizeof(*(dst_ptr))
|
|
|
|
- \| sizeof(*(src_ptr))
|
|
|
|
- \| sizeof(dst_ptr[...])
|
|
|
|
- \| sizeof(src_ptr[...])
|
|
|
|
- \) )
|
|
|
|
+ COPY_ARRAY(dst_ptr, src_ptr, n)
|
2016-09-25 09:24:03 +02:00
|
|
|
|
|
|
|
@@
|
|
|
|
type T;
|
2022-07-10 12:05:51 +02:00
|
|
|
T *dst_ptr;
|
|
|
|
T[] src_arr;
|
|
|
|
expression n;
|
2016-09-25 09:24:03 +02:00
|
|
|
@@
|
2022-07-10 12:05:51 +02:00
|
|
|
- memcpy(dst_ptr, src_arr, (n) * \( sizeof(T)
|
|
|
|
- \| sizeof(*(dst_ptr))
|
|
|
|
- \| sizeof(*(src_arr))
|
|
|
|
- \| sizeof(dst_ptr[...])
|
|
|
|
- \| sizeof(src_arr[...])
|
|
|
|
- \) )
|
|
|
|
+ COPY_ARRAY(dst_ptr, src_arr, n)
|
2016-09-25 09:24:03 +02:00
|
|
|
|
|
|
|
@@
|
|
|
|
type T;
|
2022-07-10 12:05:51 +02:00
|
|
|
T[] dst_arr;
|
2019-06-15 20:32:58 +02:00
|
|
|
T *src_ptr;
|
2022-07-10 12:05:51 +02:00
|
|
|
expression n;
|
|
|
|
@@
|
|
|
|
- memcpy(dst_arr, src_ptr, (n) * \( sizeof(T)
|
|
|
|
- \| sizeof(*(dst_arr))
|
|
|
|
- \| sizeof(*(src_ptr))
|
|
|
|
- \| sizeof(dst_arr[...])
|
|
|
|
- \| sizeof(src_ptr[...])
|
|
|
|
- \) )
|
|
|
|
+ COPY_ARRAY(dst_arr, src_ptr, n)
|
|
|
|
|
|
|
|
@@
|
|
|
|
type T;
|
2019-06-15 20:32:58 +02:00
|
|
|
T[] dst_arr;
|
|
|
|
T[] src_arr;
|
2016-09-25 09:24:03 +02:00
|
|
|
expression n;
|
|
|
|
@@
|
2022-07-10 12:05:51 +02:00
|
|
|
- memcpy(dst_arr, src_arr, (n) * \( sizeof(T)
|
|
|
|
- \| sizeof(*(dst_arr))
|
|
|
|
- \| sizeof(*(src_arr))
|
|
|
|
- \| sizeof(dst_arr[...])
|
|
|
|
- \| sizeof(src_arr[...])
|
|
|
|
- \) )
|
2019-06-15 20:32:58 +02:00
|
|
|
+ COPY_ARRAY(dst_arr, src_arr, n)
|
2017-02-25 11:30:03 +01:00
|
|
|
|
2017-07-15 21:36:20 +02:00
|
|
|
@@
|
|
|
|
type T;
|
|
|
|
T *dst;
|
|
|
|
T *src;
|
|
|
|
expression n;
|
|
|
|
@@
|
|
|
|
(
|
|
|
|
- memmove(dst, src, (n) * sizeof(*dst));
|
|
|
|
+ MOVE_ARRAY(dst, src, n);
|
|
|
|
|
|
|
|
|
- memmove(dst, src, (n) * sizeof(*src));
|
|
|
|
+ MOVE_ARRAY(dst, src, n);
|
|
|
|
|
|
|
|
|
- memmove(dst, src, (n) * sizeof(T));
|
|
|
|
+ MOVE_ARRAY(dst, src, n);
|
|
|
|
)
|
|
|
|
|
2017-02-25 11:30:03 +01:00
|
|
|
@@
|
|
|
|
type T;
|
|
|
|
T *ptr;
|
|
|
|
expression n;
|
|
|
|
@@
|
2017-10-01 17:12:08 +02:00
|
|
|
- ptr = xmalloc((n) * sizeof(*ptr));
|
2017-02-25 11:30:03 +01:00
|
|
|
+ ALLOC_ARRAY(ptr, n);
|
|
|
|
|
|
|
|
@@
|
|
|
|
type T;
|
|
|
|
T *ptr;
|
|
|
|
expression n;
|
|
|
|
@@
|
2017-10-01 17:12:08 +02:00
|
|
|
- ptr = xmalloc((n) * sizeof(T));
|
2017-02-25 11:30:03 +01:00
|
|
|
+ ALLOC_ARRAY(ptr, n);
|
2021-03-13 17:17:22 +01:00
|
|
|
|
|
|
|
@@
|
|
|
|
type T;
|
|
|
|
T *ptr;
|
2021-03-16 01:56:07 +01:00
|
|
|
expression n != 1;
|
2021-03-13 17:17:22 +01:00
|
|
|
@@
|
|
|
|
- ptr = xcalloc(n, \( sizeof(*ptr) \| sizeof(T) \) )
|
|
|
|
+ CALLOC_ARRAY(ptr, n)
|