diff --git a/proc/devname.c b/proc/devname.c index 6e8d2863..4be24e98 100644 --- a/proc/devname.c +++ b/proc/devname.c @@ -70,7 +70,7 @@ static void load_drivers(void){ p = buf; while(( p = strstr(p, " /dev/") )){ // " /dev/" is the second column tty_map_node *tmn; - int len; + size_t len; char *end; p += 6; end = strchr(p, ' '); diff --git a/proc/escape.c b/proc/escape.c index 1fd4e74a..ca731989 100644 --- a/proc/escape.c +++ b/proc/escape.c @@ -153,7 +153,7 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m // escape an argv or environment string array // // bytes arg means sizeof(buf) -int escape_strlist(char *restrict dst, const char *restrict const *restrict src, size_t bytes, int *cells){ +int escape_strlist(char *restrict dst, char *restrict const *restrict src, size_t bytes, int *cells){ size_t i = 0; for(;;){ @@ -175,7 +175,7 @@ int escape_command(char *restrict const outbuf, const proc_t *restrict const pp, int end = 0; if(flags & ESC_ARGS){ - const char **lc = (const char**)pp->cmdline; + char **lc = (char**)pp->cmdline; if(lc && *lc) return escape_strlist(outbuf, lc, bytes, cells); } if(flags & ESC_BRACKETS){ diff --git a/proc/escape.h b/proc/escape.h index aa9f6d64..8ef7b2f2 100644 --- a/proc/escape.h +++ b/proc/escape.h @@ -14,7 +14,7 @@ EXTERN_C_BEGIN #define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it #define ESC_DEFUNCT 0x4 // mark zombies with " " -extern int escape_strlist(char *restrict dst, const char *restrict const *restrict src, size_t n, int *cells); +extern int escape_strlist(char *restrict dst, char *restrict const *restrict src, size_t n, int *cells); extern int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *maxcells); extern int escape_command(char *restrict const outbuf, const proc_t *restrict const pp, int bytes, int *cells, unsigned flags); extern int escaped_copy(char *restrict dst, const char *restrict src, int bufsize, int *maxroom); diff --git a/ps/output.c b/ps/output.c index 2cb36a2f..5dbae861 100644 --- a/ps/output.c +++ b/ps/output.c @@ -77,7 +77,6 @@ static unsigned max_leftward = 0x12345678; /* space for LEFT stuff */ static int wide_signals; /* true if we have room */ static time_t seconds_since_1970; -static time_t time_of_boot; static unsigned long page_shift; @@ -625,7 +624,7 @@ static int pr_pri_api(char *restrict const outbuf, const proc_t *restrict const } static int pr_nice(char *restrict const outbuf, const proc_t *restrict const pp){ - if(pp->sched!=0 && pp->sched!=-1) return snprintf(outbuf, COLWID, "-"); + if(pp->sched!=0 && pp->sched!=(unsigned long)-1) return snprintf(outbuf, COLWID, "-"); return snprintf(outbuf, COLWID, "%ld", pp->nice); } @@ -662,11 +661,11 @@ static int pr_class(char *restrict const outbuf, const proc_t *restrict const pp // default "%u:%u", type, prio // We just print the priority, and have other keywords for type. static int pr_rtprio(char *restrict const outbuf, const proc_t *restrict const pp){ - if(pp->sched==0 || pp->sched==-1) return snprintf(outbuf, COLWID, "-"); + if(pp->sched==0 || pp->sched==(unsigned long)-1) return snprintf(outbuf, COLWID, "-"); return snprintf(outbuf, COLWID, "%ld", pp->rtprio); } static int pr_sched(char *restrict const outbuf, const proc_t *restrict const pp){ - if(pp->sched==-1) return snprintf(outbuf, COLWID, "-"); + if(pp->sched==(unsigned long)-1) return snprintf(outbuf, COLWID, "-"); return snprintf(outbuf, COLWID, "%ld", pp->sched); } diff --git a/ps/stacktrace.c b/ps/stacktrace.c index 1e84188f..c2b4ece0 100644 --- a/ps/stacktrace.c +++ b/ps/stacktrace.c @@ -30,7 +30,7 @@ static void debug_stop(char **args){ } /***********/ -static void stack_trace_sigchld(int signum){ +static void stack_trace_sigchld(int signum __attribute__ ((__unused__))){ stack_trace_done = 1; } @@ -156,7 +156,7 @@ void debug(int method, char *prog_name){ } /************/ -static void stack_trace_sigsegv(int signum){ +static void stack_trace_sigsegv(int signum __attribute__ ((__unused__))){ debug(STACK_TRACE, stored_prog_name); }