Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31544 )
Change subject: commonlib: Add Bubble sort algorithm ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/#/c/31544/3/src/commonlib/include/commonlib/sort... File src/commonlib/include/commonlib/sort.h:
https://review.coreboot.org/#/c/31544/3/src/commonlib/include/commonlib/sort... PS3, Line 16: SORT_H_
nit: _COMMONLIB_SORT_H_?
Ack
https://review.coreboot.org/#/c/31544/3/src/include/stdlib.h File src/include/stdlib.h:
https://review.coreboot.org/#/c/31544/3/src/include/stdlib.h@9 PS3, Line 9: #define swap(a, b) do { \
This needs to be in commonlib if the function using it is in commonlib (probably commonlib/helpers. […]
Agree, will move to commonlib/helpers.h
https://review.coreboot.org/#/c/31544/3/src/include/stdlib.h@13 PS3, Line 13: } while (0)
edit: Actually, if you do decide to leave it like this, maybe call it SWAP() because then it's clear […]
In my point of view a macro can deal with lvalue pretty fine in this case. So if you are not totally against it I would like to keep it. I agree though to change it to uppercase, that will align better with existing macros like MIN, MAX and the like in helpers.h.