summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-01 04:14:14 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-01 04:14:14 +0000
commit0abc048e8633d579be3759bfd83685b7afa76df3 (patch)
tree7fc774d10096a94d6bcc28223d90a5de0a0e704f /read.c
parent5a0753265874ce0fe8a026f0557553bd1fd6b036 (diff)
downloadmandoc-0abc048e8633d579be3759bfd83685b7afa76df3.tar.gz
The file read.c is part of the parser, so it cannot include main.h,
which is not part of the parser. Besides, the parser *does* modify the input buffer, so marking it "const" in the mparse_readmem() interface is an outright lie. Fix all this by killing the const, the UNCONST, and the bogus inclusion.
Diffstat (limited to 'read.c')
-rw-r--r--read.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/read.c b/read.c
index ecb0d827..558c5e94 100644
--- a/read.c
+++ b/read.c
@@ -41,7 +41,6 @@
#include "libmandoc.h"
#include "mdoc.h"
#include "man.h"
-#include "main.h"
#define REPARSE_LIMIT 1000
@@ -756,12 +755,12 @@ mparse_parse_buffer(struct mparse *curp, struct buf blk, const char *file)
}
enum mandoclevel
-mparse_readmem(struct mparse *curp, const void *buf, size_t len,
+mparse_readmem(struct mparse *curp, void *buf, size_t len,
const char *file)
{
struct buf blk;
- blk.buf = UNCONST(buf);
+ blk.buf = buf;
blk.sz = len;
mparse_parse_buffer(curp, blk, file);