comparison src/core/date.cpp @ 36:2743011a6042

*: mass update formatted all source files, converted ALL instances of setStyleSheet() to palettes and fonts (stylesheets suck), and I changed the clang-format file because it wasn't working on my laptop for some reason.
author Paper <mrpapersonic@gmail.com>
date Thu, 21 Sep 2023 15:17:47 -0400
parents cde8f67a7c7d
children d8eb763e6661
comparison
equal deleted inserted replaced
35:329b7921a6be 36:2743011a6042
4 #include <cstdint> 4 #include <cstdint>
5 #include <tuple> 5 #include <tuple>
6 6
7 /* An implementation of AniList's "fuzzy date" */ 7 /* An implementation of AniList's "fuzzy date" */
8 8
9 #define MIN(A, B) \ 9 #define MIN(A, B) \
10 ({ \ 10 ({ \
11 __typeof__(A) __a = (A); \ 11 __typeof__(A) __a = (A); \
12 __typeof__(B) __b = (B); \ 12 __typeof__(B) __b = (B); \
13 __a < __b ? __a : __b; \ 13 __a < __b ? __a : __b; \
14 }) 14 })
15 #define MAX(A, B) \ 15 #define MAX(A, B) \
16 ({ \ 16 ({ \
17 __typeof__(A) __a = (A); \ 17 __typeof__(A) __a = (A); \
18 __typeof__(B) __b = (B); \ 18 __typeof__(B) __b = (B); \
19 __a < __b ? __b : __a; \ 19 __a < __b ? __b : __a; \
20 }) 20 })
21 21
22 #define CLAMP(x, low, high) \ 22 #define CLAMP(x, low, high) \
23 ({ \ 23 ({ \
24 __typeof__(x) __x = (x); \ 24 __typeof__(x) __x = (x); \
25 __typeof__(low) __low = (low); \ 25 __typeof__(low) __low = (low); \
26 __typeof__(high) __high = (high); \ 26 __typeof__(high) __high = (high); \
27 __x > __high ? __high : (__x < __low ? __low : __x); \ 27 __x > __high ? __high : (__x < __low ? __low : __x); \
28 }) 28 })
29 29
30 Date::Date() { 30 Date::Date() {
31 } 31 }
32 32