diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-09 11:31:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-09 11:31:43 +0000 |
commit | 48b1f615ccd6f22e18e6caa0135684dc84559119 (patch) | |
tree | 01deacc78fec1751c9603d62f9046a803a9a5e07 | |
parent | e8a3453579a72aae8c47741db7c4ea6dbb18ccc5 (diff) | |
download | mandoc-48b1f615ccd6f22e18e6caa0135684dc84559119.tar.gz |
mark defos as const; nobody needs to change it,
and it is occasionally useful to be able to pass literal strings
-rw-r--r-- | libmandoc.h | 3 | ||||
-rw-r--r-- | libmdoc.h | 2 | ||||
-rw-r--r-- | mandoc.h | 3 | ||||
-rw-r--r-- | mdoc.c | 2 | ||||
-rw-r--r-- | read.c | 4 |
5 files changed, 8 insertions, 6 deletions
diff --git a/libmandoc.h b/libmandoc.h index 882d701d..51828a21 100644 --- a/libmandoc.h +++ b/libmandoc.h @@ -50,7 +50,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 *); @@ -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 */ @@ -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 *); @@ -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; @@ -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; |