Commit Diff


commit - f462256db27f827590a5867e046d0bbbb8eb368a
commit + a8ec4910fd7d67df09ca79179dff8a344cc13cf2
blob - 8e889e638bd4d892068ae58e86782a82f793bab9
blob + 1489ebd89a9d37f4023d844604b113a9a8e201e0
--- include/u.h
+++ include/u.h
@@ -10,8 +10,10 @@ extern "C" {
 #define _BSD_SOURCE 1
 #define _NETBSD_SOURCE 1	/* NetBSD */
 #define _SVID_SOURCE 1
-#define _XOPEN_SOURCE 1000
-#define _XOPEN_SOURCE_EXTENDED 1
+#ifndef __APPLE__
+#	define _XOPEN_SOURCE 1000
+#	define _XOPEN_SOURCE_EXTENDED 1
+#endif
 #define _LARGEFILE64_SOURCE 1
 #define _FILE_OFFSET_BITS 64
 
@@ -78,6 +80,7 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)
 #	endif
 #	undef _ANSI_SOURCE
 #	undef _POSIX_C_SOURCE
+#	undef _XOPEN_SOURCE
 #	if !defined(NSIG)
 #		define NSIG 32
 #	endif
blob - bd6e7188cd7b0f26efb993efb5d0a3e8bfebbda2
blob + 51d71c4af79beb0a947cf639766c7aad9e64290b
--- src/cmd/acidtypes/stabs.c
+++ src/cmd/acidtypes/stabs.c
@@ -146,6 +146,7 @@ parseinfo(char *desc, char **pp)
 	Type *t;
 	char *attr;
 
+	n1 = n2 = 0;
 	parsenum(desc, &n1, &n2, &desc);
 	t = typebynum(n1, n2);
 	if(*desc != '='){
blob - ccc7f58599c80fc3251a6e03891b8731294890d8
blob + 7bccd3abb77217fe9703ca501b5d7d6de68b2cab
--- src/cmd/acme/edit.c
+++ src/cmd/acme/edit.c
@@ -605,6 +605,7 @@ simpleaddr(void)
 	Addr addr;
 	Addr *ap, *nap;
 
+	addr.num = 0;
 	addr.next = 0;
 	addr.u.left = 0;
 	switch(cmdskipbl()){
blob - 000b34042a495854b832b2139a89643073d9eadf
blob + c22213f22a8a22fc10bd13316e74295dc185bad7
--- src/cmd/acme/look.c
+++ src/cmd/acme/look.c
@@ -696,6 +696,8 @@ openfile(Text *t, Expand *e)
 	Rune *rp;
 	uint dummy;
 
+	r.q0 = 0;
+	r.q1 = 0;
 	if(e->nname == 0){
 		w = t->w;
 		if(w == nil)
blob - da6c2a220e676a679c56e776a44d7afd3dda74c8
blob + 46ba5cbf119893acadc01000547032f34f64b7b6
--- src/cmd/auxstats/Darwin.c
+++ src/cmd/auxstats/Darwin.c
@@ -83,6 +83,7 @@ kread(ulong addr, char *buf, int size)
 void
 xnet(int first)
 {
+#if 0
 	ulong out, in, outb, inb, err;
 	static ulong ifnetaddr;
 	ulong addr;
@@ -123,6 +124,8 @@ xnet(int first)
 	Bprint(&bout, "ethererr %lud\n", err);
 	Bprint(&bout, "ether %lud\n", in+out);
 	Bprint(&bout, "etherb %lud\n", inb+outb);
+#endif
+	USED(first);
 }
 
 
blob - f44acb062a0e93d160582b45b7c411fca867c637
blob + 60ba83ca4e8dcfa90e35472796a96e8da28bc76f
--- src/cmd/ed.c
+++ src/cmd/ed.c
@@ -929,7 +929,7 @@ callunix(void)
 	*p = 0;
 	pid = fork();
 	if(pid == 0) {
-		execlp("rc", "rc", "-c", buf, 0);
+		execlp("rc", "rc", "-c", buf, (char*)0);
 		sysfatal("exec failed: %r");
 		exits("execl failed");
 	}
blob - 6fa0da9f507a9edc5199b9f49de1e6c9f3126a4d
blob + 46fd3f8a11d2da2340e3d4c70d144b18d26a63f2
--- src/cmd/hist.c
+++ src/cmd/hist.c
@@ -144,7 +144,7 @@ ysearch(char *file)
 				print("diff %s %s\n", pair[toggle^1], pair[toggle]);
 			switch(rfork(RFFDG|RFPROC)){
 			case 0:
-				execlp("diff", "diff", diffb ? "-cb" : "-c", pair[toggle], pair[toggle ^ 1], 0);
+				execlp("diff", "diff", diffb ? "-cb" : "-c", pair[toggle], pair[toggle ^ 1], (char*)0);
 				fprint(2, "can't exec diff: %r\n");
 				exits(0);
 			case -1:
blob - d3e3151bac28b062f5fae01dce5ffa20ddc75bce
blob + 8f3d5ac4ee7544ca948aceb06771df36e86373fd
--- src/cmd/pic/pltroff.c
+++ src/cmd/pic/pltroff.c
@@ -144,11 +144,6 @@ void vgoto(double n)
 	vpos = n;
 }
 
-double fabs(double x)
-{
-	return x < 0 ? -x : x;
-}
-
 void hvflush(void)	/* get to proper point for output */
 {
 	if (fabs(hpos-htrue) >= 0.0005) {
blob - fc0dfc139520b0a5f16df61d024e172b4397967e
blob + d976b40a532a695c206a202ccf079606c0496039
--- src/cmd/postscript/tr2post/Bgetfield.c
+++ src/cmd/postscript/tr2post/Bgetfield.c
@@ -108,7 +108,7 @@ Bgetfield(Biobuf *bp, int type, void *thing, int size)
 		while (!bailout && (r = Bgetrune(bp))>=0) {
 			switch (sindex++) {
 			case 0:
-				if (*c == '0') {
+				if (r == '0') {
 					base = 8;
 					continue;
 				}
blob - 81ac0b3396037f70ffd1430e7122c238bdd1f27e
blob + e96055f27d9e3e22ebdbafdeb6b30936c342db54
--- src/lib9/await.c
+++ src/lib9/await.c
@@ -4,9 +4,9 @@
 
 #include <signal.h>
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <sys/time.h>
 #include <sys/resource.h>
-#include <sys/wait.h>
 
 #ifndef WCOREDUMP	/* not on Mac OS X Tiger */
 #define WCOREDUMP(status) 0
blob - 436c1b77f7c474c25c638833a084e377f5c3b95e
blob + 8761cc9d9e3cbee935d9dd5575bdf4b2d33f8868
--- src/libauth/auth_proxy.c
+++ src/libauth/auth_proxy.c
@@ -91,6 +91,7 @@ auth_getinfo(AuthRpc *rpc)
 
 	if(auth_rpc(rpc, "authinfo", nil, 0) != ARok)
 		return nil;
+	a = nil;
 	if(convM2AI((uchar*)rpc->arg, rpc->narg, &a) == nil){
 		werrstr("bad auth info from factotum");
 		return nil;
blob - a0180ae2e9eb7cc54eac2c83d2e5c75d8495b911
blob + ee5f98502eb8e33f810e3d8de9333722c66c187d
--- src/libsunrpc/nfs3.c
+++ src/libsunrpc/nfs3.c
@@ -115,7 +115,7 @@ static struct {
 };
 
 void
-nfs3errstr(SunStatus status)
+nfs3errstr(Nfs3Status status)
 {
 	int i;