mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 00:51:24 +03:00
util: use GNU comparison function prototype for qsort_safe()
This commit is contained in:
parent
7185d80558
commit
aeb24f3081
@ -779,12 +779,12 @@ int shall_restore_state(void);
|
||||
* Normal qsort requires base to be nonnull. Here were require
|
||||
* that only if nmemb > 0.
|
||||
*/
|
||||
static inline void qsort_safe(void *base, size_t nmemb, size_t size,
|
||||
int (*compar)(const void *, const void *)) {
|
||||
if (nmemb) {
|
||||
assert(base);
|
||||
qsort(base, nmemb, size, compar);
|
||||
}
|
||||
static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
|
||||
if (nmemb <= 0)
|
||||
return;
|
||||
|
||||
assert(base);
|
||||
qsort(base, nmemb, size, compar);
|
||||
}
|
||||
|
||||
int proc_cmdline(char **ret);
|
||||
|
Loading…
Reference in New Issue
Block a user