From 60ea60059935071c53a2e34db5765f79800a0c51 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 26 Feb 2012 00:16:44 +0100 Subject: [PATCH] ps: fix compiler warnings common.h:23:19: warning: ISO C does not permit named variadic macros [-Wvariadic-macros] global.c:499:3: warning: ISO C does not support the '%Ld' gnu_printf format [-Wformat] output.c:134:1: warning: 'sr_cstime' defined but not used [-Wunused-function] output.c:816:3: warning: ISO C does not support the '%Lu' gnu_printf format [-Wformat] output.c:816:3: warning: ISO C does not support the '%Lu' gnu_printf format [-Wformat] Signed-off-by: Sami Kerola --- ps/common.h | 4 ++-- ps/global.c | 2 +- ps/output.c | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ps/common.h b/ps/common.h index 72ffa744..157e6dfb 100644 --- a/ps/common.h +++ b/ps/common.h @@ -18,9 +18,9 @@ #include "../proc/readproc.h" #if 0 -#define trace(args...) printf(## args) +#define trace(...) printf(## __VA_ARGS__) #else -#define trace(args...) +#define trace(...) #endif diff --git a/ps/global.c b/ps/global.c index 0898a5ea..be78ec75 100644 --- a/ps/global.c +++ b/ps/global.c @@ -492,7 +492,7 @@ void self_info(void){ fprintf(stderr, "personality=0x%08x (from \"%s\")\n" - "EUID=%d TTY=%d,%d Hertz=%Ld page_size=%d\n", + "EUID=%d TTY=%d,%d Hertz=%lld page_size=%d\n", personality, saved_personality_text, cached_euid, (int)major(cached_tty), (int)minor(cached_tty), Hertz, (int)(page_size) diff --git a/ps/output.c b/ps/output.c index 104d0342..58d0cf62 100644 --- a/ps/output.c +++ b/ps/output.c @@ -131,7 +131,6 @@ static int sr_ ## NAME (const proc_t* P, const proc_t* Q) { \ CMP_INT(rtprio) CMP_SMALL(sched) CMP_INT(cutime) -CMP_INT(cstime) CMP_SMALL(priority) /* nice */ CMP_SMALL(nlwp) CMP_SMALL(nice) /* priority */ @@ -817,7 +816,7 @@ static int old_time_helper(char *dst, unsigned long long t, unsigned long long r if(!t) return snprintf(dst, COLWID, " -"); if(t == ~0ULL) return snprintf(dst, COLWID, " xx"); if((long long)(t-=rel) < 0) t=0ULL; - if(t>9999ULL) return snprintf(dst, COLWID, "%5Lu", t/100ULL); + if(t>9999ULL) return snprintf(dst, COLWID, "%5llu", t/100ULL); else return snprintf(dst, COLWID, "%2u.%02u", (unsigned)t/100U, (unsigned)t%100U); } -- 2.40.0