diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-13 10:21:24 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-13 10:21:24 +0000 |
commit | 5cf7b56146264fe9cc6ca3f7594e29a1da4df624 (patch) | |
tree | 1428bfe69ba7414af6b3c9677aad93cfab428e14 /main.c | |
parent | f06be045fa23029451ed1ae110eb8e27f016042c (diff) | |
download | mandoc-5cf7b56146264fe9cc6ca3f7594e29a1da4df624.tar.gz mandoc-5cf7b56146264fe9cc6ca3f7594e29a1da4df624.tar.zst mandoc-5cf7b56146264fe9cc6ca3f7594e29a1da4df624.zip |
Clean up consts (noted by Joerg Sonnenberger and Ulrich Sporlein).
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.44 2009/09/21 13:06:13 kristaps Exp $ */ +/* $Id: main.c,v 1.45 2009/10/13 10:21:24 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -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; |