Commit Graph

30 Commits

Author SHA1 Message Date
Daniel Flanagan dd33444f7e Clean up existing whitespace 2019-10-31 11:39:12 -05:00
Hisham Muhammad 858af2505f Protect against overflows in RichString_setAttrn 2018-02-26 11:05:12 -03:00
Hisham b54d2dde40 Check for failure in allocations. 2016-02-02 15:53:02 +01:00
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
Hisham Muhammad d34645f8f1 Array entries have been oddly flipped here for years. 2015-11-23 03:46:43 -02:00
Hisham Muhammad 7985724933 Fixes for color glitches in ncurses ABI6.
Could no longer reproduce #244 after these fixes.
2015-08-27 21:45:02 -03:00
Christian Hesse f10cbaa812 include wctype.h for iswprint() 2015-08-25 15:23:50 +02:00
Hisham Muhammad 544c7efa6b Omit non-printable characters with widechar curses.
Closes PR #111.
2015-08-20 02:07:24 -03:00
Hisham Muhammad c9cab824e9 Extra checks. 2015-08-20 01:13:20 -03:00
Hisham Muhammad 8bd603cb68 Make Unicode strings safe for ncurses 6 ABI.
Closes #241.
2015-08-20 00:31:48 -03:00
Hisham Muhammad 54f8d8154b Do not trust isalpha(c) for values > 255.
Fixes #174.

Conflicts:
	Panel.c
2015-03-23 18:14:35 -03:00
Hisham Muhammad eb229d9aef Changes for supporting separate platform subdirectories. 2014-11-24 18:55:03 -02:00
Hisham Muhammad 9faf4938b8 Refactored key handlers.
Made the logic more modular, hopefully easier to follow,
and removed repeated code.
Plus, some optimization in RichString code.
2014-11-19 23:17:52 -02:00
Hisham Muhammad 6d90e58c01 alignment improvements 2014-02-27 16:35:22 -03:00
Hisham Muhammad a0810561f3 Add extra checks in configure.ac for different locations of (n)curses.h 2013-02-26 17:10:11 +00:00
Hisham Muhammad 2a73405cd0 search and filter for the strace and lsof screens! 2012-11-10 00:31:37 +00:00
Hisham Muhammad 45f7a4fc8d Remove old memory debugging routines. We have Valgrind nowadays. 2011-12-26 22:04:29 +00:00
Hisham Muhammad 84281bdc44 major header cleanup 2011-12-26 21:35:57 +00:00
Hisham Muhammad 9b87e52d41 try to use unicode headers first 2011-11-03 22:01:54 +00:00
Hisham Muhammad a7bcf1d2e4 Try harder to find the ncurses header, fixes detection in SuSE SLES9.
(thanks to Moritz Barsnick)
2011-09-08 01:45:16 +00:00
Hisham Muhammad d8e1480a27 Remove arbitrary limit from rich strings
Fix subtree hiding
Fix reading of CPU values in hidden threads
Fix hiding of zombie processes as kernel threads
Remove "debug proc" code
Code cleanup in processElements
2010-11-22 12:40:20 +00:00
Hisham Muhammad 02a30bfecd warning fixes 2010-02-25 01:43:18 +00:00
Hisham Muhammad 3e6be2d7f7 fix to minor bug affecting the build process, a maintenance release will follow shortly. 2009-06-08 21:08:02 +00:00
Hisham Muhammad 6330ff3a0a changes for htop 0.8.2 2009-06-02 04:51:23 +00:00
Hisham Muhammad 31b3a2d2db catch nonprintable characters 2009-03-11 13:51:50 +00:00
Hisham Muhammad 8fa33dc336 Add Unicode support, enabled with the --enable-unicode
flag, which requires libncursesw.
Thanks to Sergej Pupykin!
2008-03-09 02:33:23 +00:00
Hisham Muhammad 855d9eaf9a IO-wait time now counts as idle time, which is a more
accurate description. It is still available in
split time, now called detailed CPU time.
(thanks to Samuel Thibault for the report)
2007-11-09 00:40:59 +00:00
Hisham Muhammad dbe2670b69 Perform RichString operations by hand.
Avoid unnecessary operations when processing entries on ProcessList.
2006-07-12 01:16:03 +00:00
Hisham Muhammad 2f1f82ee87 Updates for new version of the MakeHeader.py script. 2006-06-06 20:41:01 +00:00
Hisham Muhammad d6231bab89 Initial import. 2006-03-04 18:16:49 +00:00