From 5cf7b56146264fe9cc6ca3f7594e29a1da4df624 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 13 Oct 2009 10:21:24 +0000 Subject: Clean up consts (noted by Joerg Sonnenberger and Ulrich Sporlein). --- html.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 5ab4c877..8001cf6c 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.62 2009/10/09 06:54:11 kristaps Exp $ */ +/* $Id: html.c,v 1.63 2009/10/13 10:21:24 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -29,11 +30,13 @@ #include "chars.h" #include "html.h" +#define UNCONST(a) ((void *)(uintptr_t)(const void *)(a)) + #define DOCTYPE "-//W3C//DTD HTML 4.01//EN" #define DTD "http://www.w3.org/TR/html4/strict.dtd" struct htmldata { - char *name; + const char *name; int flags; #define HTML_CLRLINE (1 << 0) #define HTML_NOSTACK (1 << 1) @@ -87,7 +90,8 @@ void * html_alloc(char *outopts) { struct html *h; - char *toks[4], *v; + const char *toks[4]; + char *v; toks[0] = "style"; toks[1] = "man"; @@ -106,7 +110,7 @@ html_alloc(char *outopts) } while (outopts && *outopts) - switch (getsubopt(&outopts, toks, &v)) { + switch (getsubopt(&outopts, UNCONST(toks), &v)) { case (0): h->style = v; break; @@ -600,7 +604,7 @@ void bufcat_su(struct html *h, const char *p, const struct roffsu *su) { double v; - char *u; + const char *u; v = su->scale; -- cgit v1.2.3-56-ge451