Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/mdocml/dist make buffers for parsing functions ...
details: https://anonhg.NetBSD.org/src/rev/8554575ef659
branches: trunk
changeset: 342360:8554575ef659
user: christos <christos%NetBSD.org@localhost>
date: Fri Dec 18 14:30:41 2015 +0000
description:
make buffers for parsing functions const.
diffstat:
external/bsd/mdocml/dist/libmandoc.h | 4 ++--
external/bsd/mdocml/dist/mandoc.h | 4 ++--
external/bsd/mdocml/dist/preconv.c | 10 +++++-----
external/bsd/mdocml/dist/read.c | 10 +++++-----
4 files changed, 14 insertions(+), 14 deletions(-)
diffs (114 lines):
diff -r 5afd638c5e09 -r 8554575ef659 external/bsd/mdocml/dist/libmandoc.h
--- a/external/bsd/mdocml/dist/libmandoc.h Fri Dec 18 14:30:16 2015 +0000
+++ b/external/bsd/mdocml/dist/libmandoc.h Fri Dec 18 14:30:41 2015 +0000
@@ -1,4 +1,4 @@
-/* $Id: libmandoc.h,v 1.5 2015/12/17 22:31:12 christos Exp $ */
+/* $Id: libmandoc.h,v 1.6 2015/12/18 14:30:41 christos Exp $ */
/*
* Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze%openbsd.org@localhost>
@@ -74,7 +74,7 @@
void man_addeqn(struct man *, const struct eqn *);
int preconv_cue(const struct buf *, size_t);
-int preconv_encode(struct buf *, size_t *,
+int preconv_encode(const struct buf *, size_t *,
struct buf *, size_t *, int *);
void roff_free(struct roff *);
diff -r 5afd638c5e09 -r 8554575ef659 external/bsd/mdocml/dist/mandoc.h
--- a/external/bsd/mdocml/dist/mandoc.h Fri Dec 18 14:30:16 2015 +0000
+++ b/external/bsd/mdocml/dist/mandoc.h Fri Dec 18 14:30:41 2015 +0000
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.4 2015/12/17 22:31:12 christos Exp $ */
+/* $Id: mandoc.h,v 1.5 2015/12/18 14:30:41 christos Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze%openbsd.org@localhost>
@@ -431,7 +431,7 @@
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 *, void *, size_t,
+enum mandoclevel mparse_readmem(struct mparse *, const void *, size_t,
const char *);
void mparse_reset(struct mparse *);
void mparse_result(struct mparse *,
diff -r 5afd638c5e09 -r 8554575ef659 external/bsd/mdocml/dist/preconv.c
--- a/external/bsd/mdocml/dist/preconv.c Fri Dec 18 14:30:16 2015 +0000
+++ b/external/bsd/mdocml/dist/preconv.c Fri Dec 18 14:30:41 2015 +0000
@@ -1,4 +1,4 @@
-/* $Id: preconv.c,v 1.1.1.3 2015/12/17 21:58:48 christos Exp $ */
+/* $Id: preconv.c,v 1.2 2015/12/18 14:30:41 christos Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
* Copyright (c) 2014 Ingo Schwarze <schwarze%openbsd.org@localhost>
@@ -26,14 +26,14 @@
#include "libmandoc.h"
int
-preconv_encode(struct buf *ib, size_t *ii, struct buf *ob, size_t *oi,
+preconv_encode(const struct buf *ib, size_t *ii, struct buf *ob, size_t *oi,
int *filenc)
{
- unsigned char *cu;
+ const unsigned char *cu;
int nby;
unsigned int accum;
- cu = (unsigned char *)ib->buf + *ii;
+ cu = (const unsigned char *)ib->buf + *ii;
assert(*cu & 0x80);
if ( ! (*filenc & MPARSE_UTF8))
@@ -90,7 +90,7 @@
assert(accum < 0xd800 || accum > 0xdfff);
*oi += snprintf(ob->buf + *oi, 11, "\\[u%.4X]", accum);
- *ii = (char *)cu - ib->buf;
+ *ii = (const char *)cu - ib->buf;
*filenc &= ~MPARSE_LATIN1;
return(1);
diff -r 5afd638c5e09 -r 8554575ef659 external/bsd/mdocml/dist/read.c
--- a/external/bsd/mdocml/dist/read.c Fri Dec 18 14:30:16 2015 +0000
+++ b/external/bsd/mdocml/dist/read.c Fri Dec 18 14:30:41 2015 +0000
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.11 2015/12/17 22:31:12 christos Exp $ */
+/* $Id: read.c,v 1.12 2015/12/18 14:30:41 christos Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze%openbsd.org@localhost>
@@ -68,7 +68,7 @@
static void choose_parser(struct mparse *);
static void resize_buf(struct buf *, size_t);
-static void mparse_buf_r(struct mparse *, struct buf, size_t, int);
+static void mparse_buf_r(struct mparse *, const struct buf, size_t, int);
static int read_whole_file(struct mparse *, const char *, int,
struct buf *, int *);
static void mparse_end(struct mparse *);
@@ -318,7 +318,7 @@
* and indirectly (for .so file inclusion).
*/
static void
-mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
+mparse_buf_r(struct mparse *curp, const struct buf blk, size_t i, int start)
{
const struct tbl_span *span;
struct buf ln;
@@ -748,12 +748,12 @@
}
enum mandoclevel
-mparse_readmem(struct mparse *curp, void *buf, size_t len,
+mparse_readmem(struct mparse *curp, const void *buf, size_t len,
const char *file)
{
struct buf blk;
- blk.buf = buf;
+ blk.buf = __UNCONST(buf);
blk.sz = len;
mparse_parse_buffer(curp, blk, file);
Home |
Main Index |
Thread Index |
Old Index