wip commenting

This commit is contained in:
hugogogo
2025-03-13 16:02:27 +01:00
parent 24158c8f4d
commit 7ca02352d9
7 changed files with 62 additions and 36 deletions

View File

@@ -12,9 +12,10 @@
// mathematics
#define PERCENT(percent, total) (((float)percent / 100) * total)
#define DIV_ROUND_CLOSEST(n, d) ((((n) < 0) == ((d) < 0)) ? (((n) + (d)/2)/(d)) : (((n) - (d)/2)/(d)))
#define INT_TO_HEX_CHAR(n) ((n) < 10 ? ('0' + (n)) : ('A' + ((n) - 10)))
// text
#define SWITCH_CASE(ch) (((ch) >= 'A' && (ch) <= 'Z') || ((ch) >= 'a' && (ch) <= 'z') ? ((ch) ^ (1 << 5)) : (ch))
#define SWITCH_CASE(ch) (((ch) >= 'A' && (ch) <= 'Z') || ((ch) >= 'a' && (ch) <= 'z') ? ((ch) ^ (1 << 5)) : (ch))
// boolean
#define TRUE 1