Replaces WRAP_SUBTRACT with saturatingSub inline function to reduce code duplication.

This commit is contained in:
fraggerfox
2021-06-12 14:22:57 +05:30
committed by BenBE
parent 2f5b3ef733
commit 3770769ed1
2 changed files with 13 additions and 15 deletions

View File

@ -69,7 +69,7 @@
#define IGNORE_WCASTQUAL_END
#endif
/* This subtraction is used by NetBSD / OpenBSD for calculation of CPU usage items. */
/* This subtraction is used by Linux / NetBSD / OpenBSD for calculation of CPU usage items. */
static inline unsigned long long saturatingSub(unsigned long long a, unsigned long long b) {
return a > b ? a - b : 0;
}