From e55016def5ff7def99776e29c6940537d4773efc Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 3 Oct 2017 00:00:00 -0500 Subject: [PATCH] top: when did scale_mem parm lose 'unsigned' qualifier Well, for some strange unknown reason it happened in a commit referenced below. But this patch reverts it and puts this newlib scale_mem on par with the master guy. [ a little more research reveals that it should have ] [ been reverted in the 2nd commit shown. that's when ] [ types were fixed after XTRA_PROCPS_DEBUG was used. ] Reference(s): . when 'unsigned' qualifier lost commit 911083bf76783bcb0052d3d6641753107539d4ec . when 'unsigned' qualifier not restored commit 105058ae2dbd89aa5e2f327d819a143f3ab65186 . when XTRA_PROCPS_DEBUG validation introduced commit e3270d463de7eebd9f5ae20c85495e3cb5b69a9f Signed-off-by: Jim Warner --- top/top.c | 2 +- top/top.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/top/top.c b/top/top.c index c7e8e52d..3378587f 100644 --- a/top/top.c +++ b/top/top.c @@ -1465,7 +1465,7 @@ static inline const char *make_str_utf8 (const char *str, int width, int justr, * Do some scaling then justify stuff. * We'll interpret 'num' as a kibibytes quantity and try to * format it to reach 'target' while also fitting 'width'. */ -static const char *scale_mem (int target, long num, int width, int justr) { +static const char *scale_mem (int target, unsigned long num, int width, int justr) { // SK_Kb SK_Mb SK_Gb SK_Tb SK_Pb SK_Eb #ifdef BOOST_MEMORY static const char *fmttab[] = { "%.0f", "%#.1f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", NULL }; diff --git a/top/top.h b/top/top.h index 63380927..b021079a 100644 --- a/top/top.h +++ b/top/top.h @@ -585,7 +585,7 @@ typedef struct WIN_t { //atic inline const char *make_num (long num, int width, int justr, int col, int noz); //atic inline const char *make_str (const char *str, int width, int justr, int col); //atic inline const char *make_str_utf8 (const char *str, int width, int justr, int col); -//atic const char *scale_mem (int target, long num, int width, int justr); +//atic const char *scale_mem (int target, unsigned long num, int width, int justr); //atic const char *scale_num (unsigned long num, int width, int justr); //atic const char *scale_pcnt (float num, int width, int justr); //atic const char *scale_tics (TIC_t tics, int width, int justr);