OP-TEE / optee_os

Trusted side of the TEE
Other
1.59k stars 1.07k forks source link

libutils: qsort helper for standard types #6944

Closed etienne-lms closed 4 months ago

etienne-lms commented 4 months ago

Add qsort_int(), qsort_uint(), qsort_u32() and friends as qsort() helper functions to sort standard typed arrays.

I needed to use qsort() in few separated source files and needed to redefine locally the cmp_xxx() callback so I think it's worth having some generic helper functions.

etienne-lms commented 4 months ago

Comment addressed, thanks gain for the macro. I've straight fix the commit instead of appending a fixup commit.

jenswi-linaro commented 4 months ago

With my comment addressed: Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

etienne-lms commented 4 months ago

Macro name fixed. I also changed the license terms: it was BSD-3-Clause in my initial post, but I think BSD-2-Clause better applies since it is OP-TEE OS native license terms. With these 2 changes, I've applied your R-b tag that I think is still accurate.