From d4bc9052beb3305d64a353a16641740380eb87af Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Fri, 21 Jun 2019 10:00:58 -0700 Subject: Turn on warnings when building libap. For ape, we never enabled warnings in cflags. Turning it on brings up a lot of warnings. Most are noise, but a few caught unused variables and trunctaions of pointers. to smaller integers (int, long). A few warnings remain. --- sys/src/ape/lib/ap/plan9/_buf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/src/ape/lib/ap/plan9/_buf.c') diff --git a/sys/src/ape/lib/ap/plan9/_buf.c b/sys/src/ape/lib/ap/plan9/_buf.c index 906c2335d..185095c8c 100644 --- a/sys/src/ape/lib/ap/plan9/_buf.c +++ b/sys/src/ape/lib/ap/plan9/_buf.c @@ -2,6 +2,7 @@ #define _LOCK_EXTENSION #include "lib.h" #include +#include #include #include #include @@ -57,7 +58,7 @@ _startbuf(int fd) if(mux == 0){ _RFORK(RFREND); mux = (Muxseg*)_SEGATTACH(0, "shared", 0, sizeof(Muxseg)); - if((long)mux == -1){ + if(mux == (void*)-1){ _syserrno(); return -1; } @@ -124,7 +125,7 @@ Found: while((v = _RENDEZVOUS(&b->copypid, 0)) == (void*)~0) ; - _muxsid = (int)v; + _muxsid = (uintptr_t)v; /* leave fd open in parent so system doesn't reuse it */ return 0; @@ -182,6 +183,7 @@ _copyproc(int fd, Muxbuf *b) * happened, or it might mean eof; try several times to * disambiguate (posix read() discards 0-length messages) */ + n = 0; nzeros = 0; do { if(b->fd != fd) @@ -395,7 +397,7 @@ select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *timeo } mux->selwait = 1; unlock(&mux->lock); - fd = (int)_RENDEZVOUS(&mux->selwait, 0); + fd = (int)(uintptr_t)_RENDEZVOUS(&mux->selwait, 0); if(fd >= 0 && fd < nfds) { b = _fdinfo[fd].buf; if(b == 0 || b->fd != fd) { @@ -504,7 +506,7 @@ _detachbuf(void) } static int -copynotehandler(void *u, char *msg) +copynotehandler(void *, char *) { if(_finishing) _finish(0, 0); -- cgit v1.2.3