util: introduce typesafe_qsort(), a typesafe version of qsort()/qsort_safe()
authorLennart Poettering <lennart@poettering.net>
Tue, 27 Mar 2018 12:56:29 +0000 (14:56 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Apr 2018 20:30:04 +0000 (22:30 +0200)
commit1ce360813decc3ddc6dfff8c1f55927e83021404
treea5f57876ab2ab53c8975592fda45e712bca85c31
parentb667d50d3443be7fd861d319b5acd525aa15329c
util: introduce typesafe_qsort(), a typesafe version of qsort()/qsort_safe()

It does two things:

1. It derives the element size from the array argument type

2. It derives the right type for the function from the array argument
   type

Using this macro call should make the invocations of qsort() quite a bit
safer.
src/basic/util.h