Hi tech --

This diff fixes some warnings for ps(1) found with WARNINGS=yes.
mbwsprint() was missing a prototype in utf8.c, so add it to
extern.h with every other function. This lets us remove the
prototype from print.c

~Brian

Index: extern.h
===================================================================
RCS file: /cvs/src/bin/ps/extern.h,v
retrieving revision 1.20
diff -u -p -u -p -r1.20 extern.h
--- extern.h    8 Sep 2016 15:11:29 -0000       1.20
+++ extern.h    29 May 2017 19:44:43 -0000
@@ -56,6 +56,7 @@ void   logname(const struct kinfo_proc *,
 void    longtname(const struct kinfo_proc *, VARENT *);
 void    lstarted(const struct kinfo_proc *, VARENT *);
 void    maxrss(const struct kinfo_proc *, VARENT *);
+int     mbswprint(const char *, int, int);
 void    nlisterr(struct nlist *);
 void    p_rssize(const struct kinfo_proc *, VARENT *);
 void    pagein(const struct kinfo_proc *, VARENT *);
Index: print.c
===================================================================
RCS file: /cvs/src/bin/ps/print.c,v
retrieving revision 1.69
diff -u -p -u -p -r1.69 print.c
--- print.c     8 Sep 2016 15:11:29 -0000       1.69
+++ print.c     29 May 2017 19:44:43 -0000
@@ -55,8 +55,6 @@
 extern kvm_t *kd;
 extern int needenv, needcomm, neednlist, commandonly;
 
-int mbswprint(const char *, int, int);  /* utf8.c */
-
 static char *cmdpart(char *);
 
 #define        min(a,b)        ((a) < (b) ? (a) : (b))
Index: utf8.c
===================================================================
RCS file: /cvs/src/bin/ps/utf8.c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 utf8.c
--- utf8.c      10 Jan 2016 14:04:16 -0000      1.1
+++ utf8.c      29 May 2017 19:44:43 -0000
@@ -23,6 +23,8 @@
 #include <vis.h>
 #include <wchar.h>
 
+#include "ps.h"
+
 int
 mbswprint(const char *mbs, int maxwidth, int trail)
 {

Reply via email to