diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-07-09 11:30:08 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-07-09 11:30:08 +0000 |
commit | 4c357021932a15361a8aea71adc5f60ceb835037 (patch) | |
tree | e33ee278f63ebdaac817b5c5f76dcd1b5a5199b2 /usr.bin | |
parent | f3956625d9ac20de06d77c38881947fe8e6d9d91 (diff) |
mark defos as const; nobody needs to change it,
and it is occasionally useful to be able to pass literal strings
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/libmandoc.h | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/libmdoc.h | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/read.c | 6 |
5 files changed, 13 insertions, 11 deletions
diff --git a/usr.bin/mandoc/libmandoc.h b/usr.bin/mandoc/libmandoc.h index 7d62e12c289..8c450f75990 100644 --- a/usr.bin/mandoc/libmandoc.h +++ b/usr.bin/mandoc/libmandoc.h @@ -1,4 +1,4 @@ -/* $Id: libmandoc.h,v 1.27 2014/04/20 16:44:44 schwarze Exp $ */ +/* $Id: libmandoc.h,v 1.28 2014/07/09 11:30:07 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -47,7 +47,8 @@ int mandoc_strntoi(const char *, size_t, int); 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 *); diff --git a/usr.bin/mandoc/libmdoc.h b/usr.bin/mandoc/libmdoc.h index 363751ceb91..224743682fa 100644 --- a/usr.bin/mandoc/libmdoc.h +++ b/usr.bin/mandoc/libmdoc.h @@ -1,4 +1,4 @@ -/* $Id: libmdoc.h,v 1.55 2014/07/02 03:47:07 schwarze Exp $ */ +/* $Id: libmdoc.h,v 1.56 2014/07/09 11:30:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013 Ingo Schwarze <schwarze@openbsd.org> @@ -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 */ diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index 7b42fece5e1..3c7d0238d97 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.85 2014/07/07 21:35:42 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.86 2014/07/09 11:30:07 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -419,7 +419,8 @@ int mchars_spec2cp(const struct mchars *, 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 *); diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index adbc5238fcb..a5e2f7267b4 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.109 2014/07/07 15:03:24 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.110 2014/07/09 11:30:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -185,7 +185,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; diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index 9833f3d9928..d864c2b4fa6 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.46 2014/07/07 21:35:42 schwarze Exp $ */ +/* $Id: read.c,v 1.47 2014/07/09 11:30:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -57,7 +57,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); @@ -756,7 +756,7 @@ out: struct mparse * mparse_alloc(int options, enum mandoclevel wlevel, - mandocmsg mmsg, char *defos) + mandocmsg mmsg, const char *defos) { struct mparse *curp; |