Git fork

reftable/writer: drop Git-specific `QSORT()` macro

The reftable writer accidentally uses the Git-specific `QSORT()` macro.
This macro removes the need for the caller to provide the element size,
but other than that it's mostly equivalent to `qsort()`.

Replace the macro accordingly to make the library usable outside of Git.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
d4a2159a 9077923c

+4 -2
+4 -2
reftable/writer.c
··· 399 399 { 400 400 int err = 0; 401 401 402 - QSORT(refs, n, reftable_ref_record_compare_name); 402 + if (n) 403 + qsort(refs, n, sizeof(*refs), reftable_ref_record_compare_name); 403 404 404 405 for (size_t i = 0; err == 0 && i < n; i++) 405 406 err = reftable_writer_add_ref(w, &refs[i]); ··· 491 492 { 492 493 int err = 0; 493 494 494 - QSORT(logs, n, reftable_log_record_compare_key); 495 + if (n) 496 + qsort(logs, n, sizeof(*logs), reftable_log_record_compare_key); 495 497 496 498 for (size_t i = 0; err == 0 && i < n; i++) 497 499 err = reftable_writer_add_log(w, &logs[i]);