summaryrefslogtreecommitdiffstats
path: root/Header.c
AgeCommit message (Collapse)Author
2021-01-11Mark several non-modified pointer variables constChristian Göttsche
2020-12-06Remove unused function Header_readMeterNameChristian Göttsche
2020-11-28Update even more snprintfsChristian Göttsche
Use size of actual buffers instead of magic numbers
2020-11-02Embracing branchesBenny Baumann
2020-11-02Spacing around operatorsBenny Baumann
2020-10-18Make all required includes explicitBenny Baumann
Information as seen by IWYU 0.12 + clang 9 on Linux
2020-10-16Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann
2020-10-07Mark Object instances constChristian Göttsche
2020-10-05Update License consistently to GPLv2 as per COPYING fileDaniel Lange
2020-09-12Clean up some code duplication in the header filesHugo Musso Gualandi
PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
2020-09-09Consolidate repeated macro definitions into one headerNathan Scott
The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
2020-09-03Axe automated header generation.Zev Weiss
Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
2020-08-25Avoid string overflow warningChristian Göttsche
Enough memory is allocated. Header.c: In function ‘Header_readMeterName’: Header.c:157:4: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] 157 | strncpy(name, Meter_name(meter), nameLen); | ^ Header.c:154:18: note: length computed here 154 | int nameLen = strlen(Meter_name(meter)); | ^
2020-08-20Merge branch 'hishamhm-pull-960'Nathan Scott
2019-10-31Clean up existing whitespaceDaniel Flanagan
2019-02-12Restore meter name after used in Header_addMeterByName()wangqr
Fix #852
2017-07-27Security review: check results of snprintf.Hisham Muhammad
Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
2016-05-07Fix macro Header_forEachColumnExplorer09
The (this_) token was not expanded properly, but the bug was not caught because all uses of this macro specifies (this_)=this . Also parenthesize macro tokens to prevent further problems.
2016-02-02Check for failure in allocations.Hisham
2015-09-07fix calloc() callsChristian Hesse
* size_t nmemb (number of elements) first, then size_t size * do not assume char is size 1 but use sizeof() * allocate for char, not pointer to char (found by Michael McConville, fixes #261)
2015-08-19Rename String to StringUtils.David Hunt
Fixes building on case-insensitive filesystems where String.h gets confused with <string.h>. From d734dacea0a10d0465dad4e95b3421511e7da112 Mon Sep 17 00:00:00 2001 From: David Hunt <dhunt@iolanthe.attlocal.net> Date: Sat, 11 Jul 2015 20:56:31 -0500 Subject: [PATCH 1/8] Rename String to StringUtils
2015-06-12write header length (number of columns) back to configurationChristian Hesse
2015-03-16Fix saving of header states, motion in Setup screen.Hisham Muhammad
2015-01-23Another mega-patch for the refactoring process.Hisham Muhammad
Kinda runs, but functionality from the original main loop is still missing. Patience.
2015-01-21Sorry about the mega-patch.Hisham Muhammad
This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
2014-11-27Move UptimeMeter into platform-dependent area.Hisham Muhammad
Set up environment to move other meters.
2014-11-27Decouple Header from Meter classes.Hisham Muhammad
(Yes, that's dynamic typing!)
2014-04-21Restrict size of read.Hisham Muhammad
2014-02-27alignment improvementsHisham Muhammad
2014-01-16Fix order of calloc arguments.Hisham Muhammad
(Patch by Dawid Gajownik)
2012-12-05Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad
UTF-8 display of big numbers.
2011-12-26Remove old memory debugging routines. We have Valgrind nowadays.Hisham Muhammad
2011-12-26major header cleanupHisham Muhammad
2011-11-18Mega-commit with features and tweaks for 1.0:Hisham Muhammad
* Performance improvements * Support for splitting CPU meters into two or four columns (thanks to Wim Heirman) * Switch from PLPA, which is now deprecated, to HWLOC. * Bring back support for native Linux sched_setaffinity, so we don't have to use HWLOC where we don't need to. * Support for typing in user names and column fields in selection panels.
2011-05-26Tempus fugit.Hisham Muhammad
2011-03-29only reinit initializable metersHisham Muhammad
2011-03-22* Option for counting CPUs from zeroHisham Muhammad
(thanks to Sean Noonan) * Meters update in every screen (no longer halting while on Setup, etc.)
2010-02-25Tempus fugit.Hisham Muhammad
2007-11-26Avoid crashing when using many meters (thanks to David Cho for the report)Hisham Muhammad
2006-07-11Performance improvement hackathon: improve process comparison routines,Hisham Muhammad
disable useless code in release builds such as runtime type-checking on dynamic data structures and process fields that are not being computed, faster(?) method for verifying the process owner (still need to ensure correctness), don't destroy and create process objects for hidden kernel threads over and over. Phew. I shouldn't be doing all this today, but I could not resist.
2006-05-30Rename TypedVector to Vector, matching dit.Hisham Muhammad
2006-05-09Final fixes to make "All CPUs" the default CPU display mode.Hisham Muhammad
2006-04-10- Overhaul meters implementation;Hisham Muhammad
- add AllCPUsMeter; - because of that, the new .htoprc is incompatible with previous released versions.
2006-03-23Update copyrights.Hisham Muhammad
2006-03-04Initial import.Hisham Muhammad