From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Subject: MACHINE not defined and a few cast nits
Date: Sun, 18 Jan 2015 10:14:54 +0100 [thread overview]
Message-ID: <54BB798E.6070407@bsd.lv> (raw)
[-- Attachment #1: Type: text/plain, Size: 312 bytes --]
Enclosed is a patch for compilation on Mac OS X. If wraps the MACHINE
in #ifdef, but I'm not sure how to get this without invoking sysctl(3)
for each and every invocation of mandoc. Which won't work on windows
anyway, I reckon.
I also cast some unsigned char's that clang complains about.
Best,
Kristaps
[-- Attachment #2: machine.diff --]
[-- Type: text/plain, Size: 1434 bytes --]
? .DS_Store
? Makefile.local
? cgi.h
? config.h
? config.log
? configure.local
? demandoc
? machine.diff
? mandoc
Index: main.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/main.c,v
retrieving revision 1.216
diff -u -p -r1.216 main.c
--- main.c 16 Jan 2015 21:15:05 -0000 1.216
+++ main.c 18 Jan 2015 09:14:40 -0000
@@ -321,18 +321,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;
Index: preconv.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/preconv.c,v
retrieving revision 1.13
diff -u -p -r1.13 preconv.c
--- preconv.c 19 Dec 2014 04:58:35 -0000 1.13
+++ preconv.c 18 Jan 2015 09:14:40 -0000
@@ -33,7 +33,7 @@ preconv_encode(struct buf *ib, size_t *i
int nby;
unsigned int accum;
- cu = ib->buf + *ii;
+ cu = (unsigned char *)ib->buf + *ii;
assert(*cu & 0x80);
if ( ! (*filenc & MPARSE_UTF8))
next reply other threads:[~2015-01-18 9:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-18 9:14 Kristaps Dzonsons [this message]
2015-01-22 0:20 ` Ingo Schwarze
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54BB798E.6070407@bsd.lv \
--to=kristaps@bsd.lv \
--cc=tech@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).