contrib / coccinelle / array.coccion commit Merge branch 'ab/ref-filter-no-contains' (6cb3822)
   1@@
   2type T;
   3T *dst;
   4T *src;
   5expression n;
   6@@
   7- memcpy(dst, src, n * sizeof(*dst));
   8+ COPY_ARRAY(dst, src, n);
   9
  10@@
  11type T;
  12T *dst;
  13T *src;
  14expression n;
  15@@
  16- memcpy(dst, src, n * sizeof(*src));
  17+ COPY_ARRAY(dst, src, n);
  18
  19@@
  20type T;
  21T *dst;
  22T *src;
  23expression n;
  24@@
  25- memcpy(dst, src, n * sizeof(T));
  26+ COPY_ARRAY(dst, src, n);
  27
  28@@
  29type T;
  30T *dst;
  31T *src;
  32expression n;
  33@@
  34(
  35- memmove(dst, src, (n) * sizeof(*dst));
  36+ MOVE_ARRAY(dst, src, n);
  37|
  38- memmove(dst, src, (n) * sizeof(*src));
  39+ MOVE_ARRAY(dst, src, n);
  40|
  41- memmove(dst, src, (n) * sizeof(T));
  42+ MOVE_ARRAY(dst, src, n);
  43)
  44
  45@@
  46type T;
  47T *ptr;
  48expression n;
  49@@
  50- ptr = xmalloc(n * sizeof(*ptr));
  51+ ALLOC_ARRAY(ptr, n);
  52
  53@@
  54type T;
  55T *ptr;
  56expression n;
  57@@
  58- ptr = xmalloc(n * sizeof(T));
  59+ ALLOC_ARRAY(ptr, n);