chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commit961c23bd227db449039af8208733ac5927b8bf0f
treefb344b42e952b869f10df42f317d6f217998a912
parentabde16c130f30b96100b3cc332143acf7f309c96
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