Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Aug 2018 17:42:28 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337544 - in head/sys: kern sys
Message-ID:  <201808091742.w79HgSXq070874@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Aug  9 17:42:27 2018
New Revision: 337544
URL: https://svnweb.freebsd.org/changeset/base/337544

Log:
  msgbuf: Light detailing (const'ify and bool'itize)

Modified:
  head/sys/kern/subr_msgbuf.c
  head/sys/kern/subr_prf.c
  head/sys/sys/msgbuf.h

Modified: head/sys/kern/subr_msgbuf.c
==============================================================================
--- head/sys/kern/subr_msgbuf.c	Thu Aug  9 16:42:13 2018	(r337543)
+++ head/sys/kern/subr_msgbuf.c	Thu Aug  9 17:42:27 2018	(r337544)
@@ -181,7 +181,7 @@ msgbuf_addchar(struct msgbuf *mbp, int c)
  * carriage returns down this path.  So do we still need it?
  */
 void
-msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr)
+msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr)
 {
 	u_int seq;
 	size_t len, prefix_len;

Modified: head/sys/kern/subr_prf.c
==============================================================================
--- head/sys/kern/subr_prf.c	Thu Aug  9 16:42:13 2018	(r337543)
+++ head/sys/kern/subr_prf.c	Thu Aug  9 17:42:27 2018	(r337544)
@@ -120,7 +120,7 @@ static void  putchar(int ch, void *arg);
 static char *ksprintn(char *nbuf, uintmax_t num, int base, int *len, int upper);
 static void  snprintf_func(int ch, void *arg);
 
-static int msgbufmapped;		/* Set when safe to use msgbuf */
+static bool msgbufmapped;		/* Set when safe to use msgbuf */
 int msgbuftrigger;
 struct msgbuf *msgbufp;
 
@@ -1030,7 +1030,7 @@ msgbufinit(void *ptr, int size)
 	msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0);
 	if (msgbufmapped && oldp != msgbufp)
 		msgbuf_copy(oldp, msgbufp);
-	msgbufmapped = 1;
+	msgbufmapped = true;
 	oldp = msgbufp;
 }
 

Modified: head/sys/sys/msgbuf.h
==============================================================================
--- head/sys/sys/msgbuf.h	Thu Aug  9 16:42:13 2018	(r337543)
+++ head/sys/sys/msgbuf.h	Thu Aug  9 17:42:27 2018	(r337544)
@@ -71,7 +71,7 @@ extern struct	mtx msgbuf_lock;
 
 void	msgbufinit(void *ptr, int size);
 void	msgbuf_addchar(struct msgbuf *mbp, int c);
-void	msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr);
+void	msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr);
 void	msgbuf_clear(struct msgbuf *mbp);
 void	msgbuf_copy(struct msgbuf *src, struct msgbuf *dst);
 int	msgbuf_getbytes(struct msgbuf *mbp, char *buf, int buflen);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808091742.w79HgSXq070874>