From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id c75c8409; for ; Sun, 30 Nov 2014 23:14:14 -0500 (EST) Date: Sun, 30 Nov 2014 23:14:14 -0500 (EST) Message-Id: <13575420297362184593.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: The file read.c is part of the parser, so it cannot include X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- 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. Modified Files: -------------- mdocml: mandoc.h read.c Revision Data ------------- Index: mandoc.h =================================================================== RCS file: /home/cvs/mdocml/mdocml/mandoc.h,v retrieving revision 1.174 retrieving revision 1.175 diff -Lmandoc.h -Lmandoc.h -u -p -r1.174 -r1.175 --- mandoc.h +++ mandoc.h @@ -437,7 +437,7 @@ void mparse_free(struct mparse *); void mparse_keep(struct mparse *); enum mandoclevel mparse_open(struct mparse *, int *, const char *); enum mandoclevel mparse_readfd(struct mparse *, int, const char *); -enum mandoclevel mparse_readmem(struct mparse *, const void *, size_t, +enum mandoclevel mparse_readmem(struct mparse *, void *, size_t, const char *); void mparse_reset(struct mparse *); void mparse_result(struct mparse *, Index: read.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/read.c,v retrieving revision 1.103 retrieving revision 1.104 diff -Lread.c -Lread.c -u -p -r1.103 -r1.104 --- read.c +++ 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, } 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); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv