summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-13 10:21:24 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-13 10:21:24 +0000
commitfd6f541ce489626cb695b97a00cee1e243aa40a4 (patch)
treee6351231ae08a23c10a8cc87c61d52fa63093132 /main.c
parent734d66a40fa33f6cc0d644258eac531c1774e3b6 (diff)
downloadmandoc-fd6f541ce489626cb695b97a00cee1e243aa40a4.tar.gz
Clean up consts (noted by Joerg Sonnenberger and Ulrich Sporlein).
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/main.c b/main.c
index b9d9da81..aadd86ac 100644
--- a/main.c
+++ b/main.c
@@ -20,6 +20,7 @@
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -27,6 +28,8 @@
#include "mdoc.h"
#include "man.h"
+#define UNCONST(a) ((void *)(uintptr_t)(const void *)(a))
+
/* Account for FreeBSD and Linux in our declarations. */
#ifdef __linux__
@@ -576,7 +579,7 @@ static int
foptions(int *fflags, char *arg)
{
char *v, *o;
- char *toks[7];
+ const char *toks[7];
toks[0] = "ign-scope";
toks[1] = "no-ign-escape";
@@ -588,7 +591,7 @@ foptions(int *fflags, char *arg)
while (*arg) {
o = arg;
- switch (getsubopt(&arg, toks, &v)) {
+ switch (getsubopt(&arg, UNCONST(toks), &v)) {
case (0):
*fflags |= IGN_SCOPE;
break;
@@ -622,7 +625,7 @@ static int
woptions(int *wflags, char *arg)
{
char *v, *o;
- char *toks[3];
+ const char *toks[3];
toks[0] = "all";
toks[1] = "error";
@@ -630,7 +633,7 @@ woptions(int *wflags, char *arg)
while (*arg) {
o = arg;
- switch (getsubopt(&arg, toks, &v)) {
+ switch (getsubopt(&arg, UNCONST(toks), &v)) {
case (0):
*wflags |= WARN_WALL;
break;