htop/linux
Explorer09 6dae8108f8 Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses.
With the CLAMP macro replacing the combination of MIN and MAX, we will
have at least two advantages:
1. It's more obvious semantically.
2. There are no more mixes of confusing uses like MIN(MAX(a,b),c) and
   MAX(MIN(a,b),c) and MIN(a,MAX(b,c)) appearing everywhere. We unify
   the 'clamping' with a single macro.
Note that the behavior of this CLAMP macro is different from
the combination `MAX(low,MIN(x,high))`.
* This CLAMP macro expands to two comparisons instead of three from
  MAX and MIN combination. In theory, this makes the code slightly
  smaller, in case that (low) or (high) or both are computed at
  runtime, so that compilers cannot optimize them. (The third
  comparison will matter if (low)>(high); see below.)
* CLAMP has a side effect, that if (low)>(high) it will produce weird
  results. Unlike MIN & MAX which will force either (low) or (high) to
  win. No assertion of ((low)<=(high)) is done in this macro, for now.

This CLAMP macro is implemented like described in glib
<http://developer.gnome.org/glib/stable/glib-Standard-Macros.html>
and does not handle weird uses like CLAMP(a++, low++, high--) .
2016-01-15 20:26:01 +08:00
..
Battery.c Rename String to StringUtils. 2015-08-19 13:45:20 -03:00
Battery.h Another mega-patch for the refactoring process. 2015-01-23 03:08:21 -02:00
IOPriority.c Files moved and added for supporting separate platforms. 2014-11-24 18:55:49 -02:00
IOPriority.h Files moved and added for supporting separate platforms. 2014-11-24 18:55:49 -02:00
IOPriorityPanel.c Simplify constructors. 2015-03-23 19:24:34 -03:00
IOPriorityPanel.h Files moved and added for supporting separate platforms. 2014-11-24 18:55:49 -02:00
LinuxCRT.c Fix spelling of "maintainer" 2016-01-02 12:11:26 -05:00
LinuxCRT.h Move platform-dependent parts of Linux battery meter. 2014-11-27 21:04:57 -02:00
LinuxProcess.c fix calloc() calls 2015-09-07 07:52:39 +02:00
LinuxProcess.h Make column width calculation dynamic. 2015-08-20 00:32:47 -03:00
LinuxProcessList.c Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses. 2016-01-15 20:26:01 +08:00
LinuxProcessList.h Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses. 2016-01-15 20:26:01 +08:00
Platform.c Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses. 2016-01-15 20:26:01 +08:00
Platform.h Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses. 2016-01-15 20:26:01 +08:00