mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
Replaces WRAP_SUBTRACT with saturatingSub inline function to reduce code duplication.
This commit is contained in:
2
Macros.h
2
Macros.h
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user