aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/u.h7
-rw-r--r--src/cmd/acidtypes/stabs.c1
-rw-r--r--src/cmd/acme/edit.c1
-rw-r--r--src/cmd/acme/look.c2
-rw-r--r--src/cmd/auxstats/Darwin.c3
-rw-r--r--src/cmd/ed.c2
-rw-r--r--src/cmd/hist.c2
-rw-r--r--src/cmd/pic/pltroff.c5
-rw-r--r--src/cmd/postscript/tr2post/Bgetfield.c2
-rw-r--r--src/lib9/await.c2
-rw-r--r--src/libauth/auth_proxy.c1
-rw-r--r--src/libsunrpc/nfs3.c2
12 files changed, 18 insertions, 12 deletions
diff --git a/include/u.h b/include/u.h
index 8e889e63..1489ebd8 100644
--- a/include/u.h
+++ b/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
diff --git a/src/cmd/acidtypes/stabs.c b/src/cmd/acidtypes/stabs.c
index bd6e7188..51d71c4a 100644
--- a/src/cmd/acidtypes/stabs.c
+++ b/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 != '='){
diff --git a/src/cmd/acme/edit.c b/src/cmd/acme/edit.c
index ccc7f585..7bccd3ab 100644
--- a/src/cmd/acme/edit.c
+++ b/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()){
diff --git a/src/cmd/acme/look.c b/src/cmd/acme/look.c
index 000b3404..c22213f2 100644
--- a/src/cmd/acme/look.c
+++ b/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)
diff --git a/src/cmd/auxstats/Darwin.c b/src/cmd/auxstats/Darwin.c
index da6c2a22..46ba5cbf 100644
--- a/src/cmd/auxstats/Darwin.c
+++ b/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);
}
diff --git a/src/cmd/ed.c b/src/cmd/ed.c
index f44acb06..60ba83ca 100644
--- a/src/cmd/ed.c
+++ b/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");
}
diff --git a/src/cmd/hist.c b/src/cmd/hist.c
index 6fa0da9f..46fd3f8a 100644
--- a/src/cmd/hist.c
+++ b/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:
diff --git a/src/cmd/pic/pltroff.c b/src/cmd/pic/pltroff.c
index d3e3151b..8f3d5ac4 100644
--- a/src/cmd/pic/pltroff.c
+++ b/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) {
diff --git a/src/cmd/postscript/tr2post/Bgetfield.c b/src/cmd/postscript/tr2post/Bgetfield.c
index fc0dfc13..d976b40a 100644
--- a/src/cmd/postscript/tr2post/Bgetfield.c
+++ b/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;
}
diff --git a/src/lib9/await.c b/src/lib9/await.c
index 81ac0b33..e96055f2 100644
--- a/src/lib9/await.c
+++ b/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
diff --git a/src/libauth/auth_proxy.c b/src/libauth/auth_proxy.c
index 436c1b77..8761cc9d 100644
--- a/src/libauth/auth_proxy.c
+++ b/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;
diff --git a/src/libsunrpc/nfs3.c b/src/libsunrpc/nfs3.c
index a0180ae2..ee5f9850 100644
--- a/src/libsunrpc/nfs3.c
+++ b/src/libsunrpc/nfs3.c
@@ -115,7 +115,7 @@ static struct {
};
void
-nfs3errstr(SunStatus status)
+nfs3errstr(Nfs3Status status)
{
int i;