tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* MACHINE not defined and a few cast nits
@ 2015-01-18  9:14 Kristaps Dzonsons
  2015-01-22  0:20 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Kristaps Dzonsons @ 2015-01-18  9:14 UTC (permalink / raw)
  To: tech

[-- 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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-22  0:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18  9:14 MACHINE not defined and a few cast nits Kristaps Dzonsons
2015-01-22  0:20 ` Ingo Schwarze

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).