mirror of
https://github.com/Genymobile/scrcpy
synced 2024-11-11 01:10:32 +00:00
Add CLAMP() macro
This commit is contained in:
parent
17d01b5bf7
commit
aee1b39790
@ -7,6 +7,7 @@
|
|||||||
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
||||||
#define MIN(X,Y) (X) < (Y) ? (X) : (Y)
|
#define MIN(X,Y) (X) < (Y) ? (X) : (Y)
|
||||||
#define MAX(X,Y) (X) > (Y) ? (X) : (Y)
|
#define MAX(X,Y) (X) > (Y) ? (X) : (Y)
|
||||||
|
#define CLAMP(V,X,Y) MIN( MAX((V),(X)), (Y) )
|
||||||
|
|
||||||
#define container_of(ptr, type, member) \
|
#define container_of(ptr, type, member) \
|
||||||
((type *) (((char *) (ptr)) - offsetof(type, member)))
|
((type *) (((char *) (ptr)) - offsetof(type, member)))
|
||||||
|
Loading…
Reference in New Issue
Block a user