diff options
author | Ori Bernstein <ori@eigenstate.org> | 2019-06-21 10:00:58 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2019-06-21 10:00:58 -0700 |
commit | d4bc9052beb3305d64a353a16641740380eb87af (patch) | |
tree | e90babcf3b3b295d9ad218cbf8f4e852df7e6d89 /sys/src/ape/lib/ap/plan9/_buf.c | |
parent | 0af7d1fe35093690f2d8dd0613b3bf3b777674c6 (diff) |
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.
Diffstat (limited to 'sys/src/ape/lib/ap/plan9/_buf.c')
-rw-r--r-- | sys/src/ape/lib/ap/plan9/_buf.c | 10 |
1 files changed, 6 insertions, 4 deletions
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 <stdlib.h> +#include <stdint.h> #include <errno.h> #include <unistd.h> #include <signal.h> @@ -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); |