2016-09-25 09:24:03 +02:00
|
|
|
@@
|
2019-06-15 20:32:58 +02:00
|
|
|
expression dst, src, n, E;
|
2016-09-25 09:24:03 +02:00
|
|
|
@@
|
2019-06-15 20:32:58 +02:00
|
|
|
memcpy(dst, src, n * sizeof(
|
|
|
|
- E[...]
|
|
|
|
+ *(E)
|
|
|
|
))
|
2016-09-25 09:24:03 +02:00
|
|
|
|
|
|
|
@@
|
|
|
|
type T;
|
2019-06-15 20:32:58 +02:00
|
|
|
T *ptr;
|
|
|
|
T[] arr;
|
|
|
|
expression E, n;
|
2016-09-25 09:24:03 +02:00
|
|
|
@@
|
2019-06-15 20:32:58 +02:00
|
|
|
(
|
|
|
|
memcpy(ptr, E,
|
|
|
|
- n * sizeof(*(ptr))
|
|
|
|
+ n * sizeof(T)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
memcpy(arr, E,
|
|
|
|
- n * sizeof(*(arr))
|
|
|
|
+ n * sizeof(T)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
memcpy(E, ptr,
|
|
|
|
- n * sizeof(*(ptr))
|
|
|
|
+ n * sizeof(T)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
memcpy(E, arr,
|
|
|
|
- n * sizeof(*(arr))
|
|
|
|
+ n * sizeof(T)
|
|
|
|
)
|
|
|
|
)
|
2016-09-25 09:24:03 +02:00
|
|
|
|
|
|
|
@@
|
|
|
|
type T;
|
2019-06-15 20:32:58 +02:00
|
|
|
T *dst_ptr;
|
|
|
|
T *src_ptr;
|
|
|
|
T[] dst_arr;
|
|
|
|
T[] src_arr;
|
2016-09-25 09:24:03 +02:00
|
|
|
expression n;
|
|
|
|
@@
|
2019-06-15 20:32:58 +02:00
|
|
|
(
|
|
|
|
- memcpy(dst_ptr, src_ptr, (n) * sizeof(T))
|
|
|
|
+ COPY_ARRAY(dst_ptr, src_ptr, n)
|
|
|
|
|
|
|
|
|
- memcpy(dst_ptr, src_arr, (n) * sizeof(T))
|
|
|
|
+ COPY_ARRAY(dst_ptr, src_arr, n)
|
|
|
|
|
|
|
|
|
- memcpy(dst_arr, src_ptr, (n) * sizeof(T))
|
|
|
|
+ COPY_ARRAY(dst_arr, src_ptr, n)
|
|
|
|
|
|
|
|
|
- memcpy(dst_arr, src_arr, (n) * sizeof(T))
|
|
|
|
+ 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);
|