source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: mark defos as const; nobody needs to change it, and it is
Date: Wed, 9 Jul 2014 07:31:44 -0400 (EDT)	[thread overview]
Message-ID: <201407091131.s69BVikA020225@krisdoz.my.domain> (raw)

Log Message:
-----------
mark defos as const; nobody needs to change it,
and it is occasionally useful to be able to pass literal strings

Modified Files:
--------------
    mdocml:
        libmandoc.h
        libmdoc.h
        mandoc.h
        mdoc.c
        read.c

Revision Data
-------------
Index: libmdoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libmdoc.h,v
retrieving revision 1.85
retrieving revision 1.86
diff -Llibmdoc.h -Llibmdoc.h -u -p -r1.85 -r1.86
--- libmdoc.h
+++ libmdoc.h
@@ -25,7 +25,7 @@ enum	mdoc_next {
 
 struct	mdoc {
 	struct mparse	 *parse; /* parse pointer */
-	char		 *defos; /* default argument for .Os */
+	const char	 *defos; /* default argument for .Os */
 	int		  quick; /* abort parse early */
 	int		  flags; /* parse flags */
 #define	MDOC_HALT	 (1 << 0) /* error in parse: halt */
Index: mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v
retrieving revision 1.219
retrieving revision 1.220
diff -Lmdoc.c -Lmdoc.c -u -p -r1.219 -r1.220
--- mdoc.c
+++ mdoc.c
@@ -189,7 +189,7 @@ mdoc_free(struct mdoc *mdoc)
  */
 struct mdoc *
 mdoc_alloc(struct roff *roff, struct mparse *parse,
-	char *defos, int quick)
+	const char *defos, int quick)
 {
 	struct mdoc	*p;
 
Index: mandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v
retrieving revision 1.141
retrieving revision 1.142
diff -Lmandoc.h -Lmandoc.h -u -p -r1.141 -r1.142
--- mandoc.h
+++ mandoc.h
@@ -419,7 +419,8 @@ int		  mchars_spec2cp(const struct mchar
 			const char *, size_t);
 const char	 *mchars_spec2str(const struct mchars *,
 			const char *, size_t, size_t *);
-struct mparse	 *mparse_alloc(int, enum mandoclevel, mandocmsg, char *);
+struct mparse	 *mparse_alloc(int, enum mandoclevel, mandocmsg,
+			const char *);
 void		  mparse_free(struct mparse *);
 void		  mparse_keep(struct mparse *);
 enum mandoclevel  mparse_readfd(struct mparse *, int, const char *);
Index: read.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/read.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -Lread.c -Lread.c -u -p -r1.68 -r1.69
--- read.c
+++ read.c
@@ -65,7 +65,7 @@ struct	mparse {
 	mandocmsg	  mmsg; /* warning/error message handler */
 	const char	 *file;
 	struct buf	 *secondary;
-	char		 *defos; /* default operating system */
+	const char	 *defos; /* default operating system */
 };
 
 static	void	  resize_buf(struct buf *, size_t);
@@ -781,7 +781,7 @@ out:
 
 struct mparse *
 mparse_alloc(int options, enum mandoclevel wlevel,
-		mandocmsg mmsg, char *defos)
+		mandocmsg mmsg, const char *defos)
 {
 	struct mparse	*curp;
 
Index: libmandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libmandoc.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -Llibmandoc.h -Llibmandoc.h -u -p -r1.41 -r1.42
--- libmandoc.h
+++ libmandoc.h
@@ -50,7 +50,8 @@ int		 mandoc_strntoi(const char *, size_
 const char	*mandoc_a2msec(const char*);
 
 void		 mdoc_free(struct mdoc *);
-struct	mdoc	*mdoc_alloc(struct roff *, struct mparse *, char *, int);
+struct	mdoc	*mdoc_alloc(struct roff *, struct mparse *,
+			const char *, int);
 void		 mdoc_reset(struct mdoc *);
 int		 mdoc_parseln(struct mdoc *, int, char *, int);
 int		 mdoc_endparse(struct mdoc *);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-07-09 11:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201407091131.s69BVikA020225@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).