source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: The file read.c is part of the parser, so it cannot include
@ 2014-12-01  4:14 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-12-01  4:14 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-01  4:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-01  4:14 mdocml: The file read.c is part of the parser, so it cannot include schwarze

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).