From 9b1e1a0a8be9129fdf6fcb1a222a78db07fd59e5 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 6 Mar 2015 09:24:59 +0000 Subject: Allow compilation on Mac OS X, which doesn't have MACHINE defined. While there, specify some casts to satisfy the compiler warnings. OK schwarze@ --- main.c | 8 +++++--- preconv.c | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 236c3c88..c5569f61 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.222 2015/02/27 16:02:10 schwarze Exp $ */ +/* $Id: main.c,v 1.223 2015/03/06 09:24:59 kristaps Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -303,18 +303,20 @@ main(int argc, char *argv[]) argc = 1; } } else if (argc > 1 && - ((uc = argv[0]) != NULL) && + ((uc = (unsigned char *)argv[0]) != NULL) && ((isdigit(uc[0]) && (uc[1] == '\0' || (isalpha(uc[1]) && uc[2] == '\0'))) || (uc[0] == 'n' && uc[1] == '\0'))) { - search.sec = uc; + search.sec = (char *)uc; argv++; argc--; } if (search.arch == NULL) search.arch = getenv("MACHINE"); +#ifdef MACHINE if (search.arch == NULL) search.arch = MACHINE; +#endif } rc = MANDOCLEVEL_OK; diff --git a/preconv.c b/preconv.c index a2bbe9ca..87e65ea0 100644 --- a/preconv.c +++ b/preconv.c @@ -1,4 +1,4 @@ -/* $Id: preconv.c,v 1.13 2014/12/19 04:58:35 schwarze Exp $ */ +/* $Id: preconv.c,v 1.14 2015/03/06 09:24:59 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -33,7 +33,7 @@ preconv_encode(struct buf *ib, size_t *ii, struct buf *ob, size_t *oi, int nby; unsigned int accum; - cu = ib->buf + *ii; + cu = (unsigned char *)ib->buf + *ii; assert(*cu & 0x80); if ( ! (*filenc & MPARSE_UTF8)) -- cgit v1.2.3-56-ge451