]> granicus.if.org Git - procps-ng/commitdiff
ps: fix compiler warnings
authorSami Kerola <kerolasa@iki.fi>
Sat, 25 Feb 2012 23:16:44 +0000 (00:16 +0100)
committerCraig Small <csmall@enc.com.au>
Sat, 3 Mar 2012 07:36:29 +0000 (18:36 +1100)
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 <kerolasa@iki.fi>
ps/common.h
ps/global.c
ps/output.c

index 72ffa744d3f6545d80b50d7d10774a732c131858..157e6dfbc53ca452dd76c8a6ec8154bd9d43d015 100644 (file)
@@ -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
 
 
index 0898a5eaa972144aa5d1dcba87fa9b1af2dcd7ab..be78ec75cdf9a2496e3ae04662be85abbd8393a2 100644 (file)
@@ -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)
index 104d0342b80ebe13577c9e698a56b53414b07907..58d0cf62e6b4bde6368e697115e08c7d766e1f5d 100644 (file)
@@ -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);
 }