Get ready for re-setting ioprio value on un-register

Implements tests for feature

	Fixes CLAMP macro
This commit is contained in:
Marc Di Luzio
2019-05-11 11:53:52 +01:00
parent 6d14149658
commit 2249a71355
7 changed files with 148 additions and 41 deletions

View File

@@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
/**
* Value clamping helper, works like MIN/MAX but constraints a value within the range.
*/
#define CLAMP(lbound, ubound, value) MIN(MIN(lbound, ubound), MAX(MAX(lbound, ubound), value))
#define CLAMP(l, u, value) MAX(MIN(l, u), MIN(MAX(l, u), value))
/**
* Little helper to safely print into a buffer, returns a pointer into the buffer