mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-19 19:31:50 +03:00
c97d766e5b
* fix stack size, file listing works * fix scrollbar, update docs * cut long filenames * Dolphin: overhaul unlocking logic, unlocked message added * furi - added common_defines.h, minor macro cleanup; fix scrollbar type conversion * remove door opening animation * adaptive long file name shortening, item icons, invert selection * archive: browser tab, file types (beta); scenes: fix sleep emote * dont trim unknown extensions * fix string_size usage * array container for file list, fixes * better path handling * archive: renaming, adding to favorites worksl scrollbar fix: limit min bar height to 1px to prevent disappearance on large lists Co-authored-by: あく <alleteam@gmail.com>
34 lines
691 B
C
34 lines
691 B
C
#pragma once
|
|
|
|
#ifndef MAX
|
|
|
|
#define MAX(a, b) \
|
|
({ \
|
|
__typeof__(a) _a = (a); \
|
|
__typeof__(b) _b = (b); \
|
|
_a > _b ? _a : _b; \
|
|
})
|
|
#endif
|
|
|
|
#ifndef MIN
|
|
#define MIN(a, b) \
|
|
({ \
|
|
__typeof__(a) _a = (a); \
|
|
__typeof__(b) _b = (b); \
|
|
_a < _b ? _a : _b; \
|
|
})
|
|
#endif
|
|
|
|
#ifndef CLAMP
|
|
#define CLAMP(x, upper, lower) (MIN(upper, MAX(x, lower)))
|
|
#endif
|
|
|
|
// need some common semantics for those two
|
|
#ifndef SIZEOF_ARRAY
|
|
#define SIZEOF_ARRAY(arr) (sizeof(arr) / sizeof(arr[0]))
|
|
#endif
|
|
|
|
#ifndef COUNT_OF
|
|
#define COUNT_OF(x) (sizeof(x) / sizeof(x[0]))
|
|
#endif
|