contrib / coccinelle / array.coccion commit Merge branch 'ab/clone-no-tags' (a1fdc85)
   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 *ptr;
  31expression n;
  32@@
  33- ptr = xmalloc(n * sizeof(*ptr));
  34+ ALLOC_ARRAY(ptr, n);
  35
  36@@
  37type T;
  38T *ptr;
  39expression n;
  40@@
  41- ptr = xmalloc(n * sizeof(T));
  42+ ALLOC_ARRAY(ptr, n);