From: Jim Warner Date: Sun, 2 Jan 2022 06:00:09 +0000 (-0600) Subject: library: eliminate those warnings for '-Wpointer-sign' X-Git-Tag: v4.0.0~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=915b07f4ff72e1c9cf2e239124185b7207705d54;p=procps-ng library: eliminate those warnings for '-Wpointer-sign' Signed-off-by: Jim Warner --- diff --git a/proc/escape.c b/proc/escape.c index 834602c3..cab62861 100644 --- a/proc/escape.c +++ b/proc/escape.c @@ -90,7 +90,7 @@ static inline void esc_ctl (unsigned char *str, int len) { } } -int escape_str (unsigned char *dst, const unsigned char *src, int bufsize) { +int escape_str (char *dst, const char *src, int bufsize) { static __thread int utf_sw = 0; int n; @@ -106,13 +106,13 @@ int escape_str (unsigned char *dst, const unsigned char *src, int bufsize) { } if (n >= bufsize) n = bufsize-1; if (utf_sw < 0) - esc_all(dst); + esc_all((unsigned char *)dst); else - esc_ctl(dst, n); + esc_ctl((unsigned char *)dst, n); return n; } -int escape_command (unsigned char *outbuf, const proc_t *pp, int bytes, unsigned flags) { +int escape_command (char *outbuf, const proc_t *pp, int bytes, unsigned flags) { int overhead = 0; int end = 0; diff --git a/proc/escape.h b/proc/escape.h index 8ae5f812..70dd81c7 100644 --- a/proc/escape.h +++ b/proc/escape.h @@ -26,8 +26,8 @@ #define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it #define ESC_DEFUNCT 0x4 // mark zombies with " " -int escape_command (unsigned char *outbuf, const proc_t *pp, int bytes, unsigned flags); +int escape_command (char *outbuf, const proc_t *pp, int bytes, unsigned flags); -int escape_str (unsigned char *dst, const unsigned char *src, int bufsize); +int escape_str (char *dst, const char *src, int bufsize); #endif