mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
improve tk_swap
This commit is contained in:
parent
533dcd7551
commit
ed0ddbcfa3
@ -3,6 +3,7 @@
|
||||
2024/10/08
|
||||
* 完善链表(感谢兆坤提供补丁)
|
||||
* 修复 conf_json_parse (感谢兆坤提供补丁)
|
||||
* 完善宏定义(感谢兆坤提供补丁)
|
||||
|
||||
2024/10/01
|
||||
* 完善链表(感谢兆坤提供补丁)
|
||||
|
@ -408,11 +408,11 @@ typedef enum _ret_t {
|
||||
#define tk_clamp(a, mn, mx) ((a) < (mn) ? (mn) : ((a) > (mx) ? (mx) : (a)))
|
||||
#define tk_clampi(a, mn, mx) (int32_t)((a) < (mn) ? (mn) : ((a) > (mx) ? (mx) : (a)))
|
||||
#define tk_swap(a, b, type) \
|
||||
{ \
|
||||
do { \
|
||||
type temp = a; \
|
||||
a = b; \
|
||||
b = temp; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
Loading…
Reference in New Issue
Block a user