trailer: improve const correctness
[gitweb.git] / pathspec.c
index 24e0dd52322baf4a507765ae0948c98f0ec30602..86f2b449b1b43d7abb0917c07676304a666056a9 100644 (file)
@@ -446,8 +446,7 @@ void parse_pathspec(struct pathspec *pathspec,
        if (pathspec->magic & PATHSPEC_MAXDEPTH) {
                if (flags & PATHSPEC_KEEP_ORDER)
                        die("BUG: PATHSPEC_MAXDEPTH_VALID and PATHSPEC_KEEP_ORDER are incompatible");
-               qsort(pathspec->items, pathspec->nr,
-                     sizeof(struct pathspec_item), pathspec_item_cmp);
+               QSORT(pathspec->items, pathspec->nr, pathspec_item_cmp);
        }
 }
 
@@ -485,8 +484,7 @@ void copy_pathspec(struct pathspec *dst, const struct pathspec *src)
 {
        *dst = *src;
        ALLOC_ARRAY(dst->items, dst->nr);
-       memcpy(dst->items, src->items,
-              sizeof(struct pathspec_item) * dst->nr);
+       COPY_ARRAY(dst->items, src->items, dst->nr);
 }
 
 void clear_pathspec(struct pathspec *pathspec)