diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-26 22:49:11 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-26 22:49:11 +0000 |
commit | b9f9b75aeaa2d1c7ecc17d846d46393f6f324d3c (patch) | |
tree | 1add211522929da446f04ebec0a315d92fd6f371 /usr.bin | |
parent | 5b11a8e4c92cb7765423e7f7a9b7f973b5bcca41 (diff) |
fix some warnings
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/window/compress.c | 19 | ||||
-rw-r--r-- | usr.bin/window/string.c | 6 | ||||
-rw-r--r-- | usr.bin/window/ttinit.c | 8 | ||||
-rw-r--r-- | usr.bin/window/wwalloc.c | 9 | ||||
-rw-r--r-- | usr.bin/window/wwinit.c | 10 | ||||
-rw-r--r-- | usr.bin/window/wwiomux.c | 5 | ||||
-rw-r--r-- | usr.bin/window/wwopen.c | 6 | ||||
-rw-r--r-- | usr.bin/window/wwpty.c | 5 | ||||
-rw-r--r-- | usr.bin/window/wwsize.c | 7 | ||||
-rw-r--r-- | usr.bin/window/xx.c | 8 |
10 files changed, 44 insertions, 39 deletions
diff --git a/usr.bin/window/compress.c b/usr.bin/window/compress.c index 73e2a8c4dcb..7d8ec3f5ce0 100644 --- a/usr.bin/window/compress.c +++ b/usr.bin/window/compress.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compress.c,v 1.3 1997/02/25 00:04:01 downsj Exp $ */ +/* $OpenBSD: compress.c,v 1.4 1998/04/26 22:49:04 millert Exp $ */ /* $NetBSD: compress.c,v 1.3 1995/09/28 10:34:13 tls Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)compress.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: compress.c,v 1.3 1997/02/25 00:04:01 downsj Exp $"; +static char rcsid[] = "$OpenBSD: compress.c,v 1.4 1998/04/26 22:49:04 millert Exp $"; #endif #endif /* not lint */ @@ -241,30 +241,29 @@ ccinit() #endif #undef C if ((cc_output = (struct cc **) - malloc((unsigned) cc_bufsize * sizeof *cc_output)) == 0) + malloc(cc_bufsize * sizeof *cc_output)) == 0) goto nomem; if ((cc_hashcodes = (short *) - malloc((unsigned) cc_bufsize * sizeof *cc_hashcodes)) == 0) + malloc(cc_bufsize * sizeof *cc_hashcodes)) == 0) goto nomem; if ((cc_htab = (struct cc **) malloc(HSIZE * sizeof *cc_htab)) == 0) goto nomem; if ((cc_tokens = (struct cc **) - malloc((unsigned) - (cc_ntoken + tt.tt_token_max - tt.tt_token_min + 1) * + malloc((cc_ntoken + tt.tt_token_max - tt.tt_token_min + 1) * sizeof *cc_tokens)) == 0) goto nomem; if ((cc_undo = (struct cc_undo *) - malloc((unsigned) cc_bufsize * sizeof *cc_undo)) == 0) + malloc(cc_bufsize * sizeof *cc_undo)) == 0) goto nomem; for (i = tt.tt_token_min; i <= tt.tt_token_max; i++) if ((cc_places[i] = (short *) - malloc((unsigned) cc_bufsize * sizeof **cc_places)) == 0) + malloc(cc_bufsize * sizeof **cc_places)) == 0) goto nomem; cc_q0a.qforw = cc_q0a.qback = &cc_q0a; cc_q0b.qforw = cc_q0b.qback = &cc_q0b; cc_q1a.qforw = cc_q1a.qback = &cc_q1a; cc_q1b.qforw = cc_q1b.qback = &cc_q1b; - if ((p = (struct cc *) malloc((unsigned) cc_ntoken * sizeof *p)) == 0) + if ((p = (struct cc *) malloc(cc_ntoken * sizeof *p)) == 0) goto nomem; for (i = 0; i < tt.tt_ntoken; i++) { p->code = i; @@ -286,7 +285,7 @@ ccinit() } cc_tt_ob = tt_ob; cc_tt_obe = tt_obe; - if ((cc_buffer = malloc((unsigned) cc_bufsize)) == 0) + if ((cc_buffer = malloc(cc_bufsize)) == 0) goto nomem; return 0; nomem: diff --git a/usr.bin/window/string.c b/usr.bin/window/string.c index 8764dfafe2a..7a5e3cf4ceb 100644 --- a/usr.bin/window/string.c +++ b/usr.bin/window/string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: string.c,v 1.3 1997/02/25 00:04:18 downsj Exp $ */ +/* $OpenBSD: string.c,v 1.4 1998/04/26 22:49:06 millert Exp $ */ /* $NetBSD: string.c,v 1.5 1995/09/29 00:44:06 cgd Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)string.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: string.c,v 1.3 1997/02/25 00:04:18 downsj Exp $"; +static char rcsid[] = "$OpenBSD: string.c,v 1.4 1998/04/26 22:49:06 millert Exp $"; #endif #endif /* not lint */ @@ -131,7 +131,7 @@ int l; { register struct string *s; - s = (struct string *) malloc((unsigned)l + str_offset); + s = (struct string *) malloc(l + str_offset); if (s == 0) return 0; if (str_head.s_forw == 0) diff --git a/usr.bin/window/ttinit.c b/usr.bin/window/ttinit.c index d13549c948b..9d45997eda3 100644 --- a/usr.bin/window/ttinit.c +++ b/usr.bin/window/ttinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttinit.c,v 1.3 1997/02/25 00:04:24 downsj Exp $ */ +/* $OpenBSD: ttinit.c,v 1.4 1998/04/26 22:49:07 millert Exp $ */ /* $NetBSD: ttinit.c,v 1.3 1995/09/28 10:34:50 tls Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)ttinit.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: ttinit.c,v 1.3 1997/02/25 00:04:24 downsj Exp $"; +static char rcsid[] = "$OpenBSD: ttinit.c,v 1.4 1998/04/26 22:49:07 millert Exp $"; #endif #endif /* not lint */ @@ -85,7 +85,7 @@ ttinit() * Set output buffer size to about 1 second of output time. */ i = MIN(wwbaud/10, 512); - if ((tt_ob = malloc((unsigned) i)) == 0) { + if ((tt_ob = malloc(i)) == 0) { wwerrno = WWE_NOMEM; return -1; } @@ -102,7 +102,7 @@ ttinit() p++; for (q = p; *q && *q != '|' && *q != ':'; q++) ; - if (q != p && (t = malloc((unsigned) (q - p + 1))) != 0) { + if (q != p && (t = malloc(q - p + 1)) != 0) { wwterm = t; while (p < q) *t++ = *p++; diff --git a/usr.bin/window/wwalloc.c b/usr.bin/window/wwalloc.c index 9a647e85d97..cf921e99ed4 100644 --- a/usr.bin/window/wwalloc.c +++ b/usr.bin/window/wwalloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwalloc.c,v 1.3 1997/02/25 00:04:38 downsj Exp $ */ +/* $OpenBSD: wwalloc.c,v 1.4 1998/04/26 22:49:03 millert Exp $ */ /* $NetBSD: wwalloc.c,v 1.3 1995/09/28 10:35:10 tls Exp $ */ /* @@ -41,21 +41,24 @@ #if 0 static char sccsid[] = "@(#)wwalloc.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: wwalloc.c,v 1.3 1997/02/25 00:04:38 downsj Exp $"; +static char rcsid[] = "$OpenBSD: wwalloc.c,v 1.4 1998/04/26 22:49:03 millert Exp $"; #endif #endif /* not lint */ +#include <stdlib.h> #include "ww.h" char ** wwalloc(row, col, nrow, ncol, size) + int row, col, nrow, ncol; + size_t size; { register char *p, **pp; register int i; /* fast, call malloc only once */ pp = (char **) - malloc((unsigned) sizeof (char **) * nrow + size * nrow * ncol); + malloc(sizeof (char **) * nrow + size * nrow * ncol); if (pp == 0) { wwerrno = WWE_NOMEM; return 0; diff --git a/usr.bin/window/wwinit.c b/usr.bin/window/wwinit.c index 458835912b2..2be6cd10ef2 100644 --- a/usr.bin/window/wwinit.c +++ b/usr.bin/window/wwinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwinit.c,v 1.6 1997/02/25 01:18:27 downsj Exp $ */ +/* $OpenBSD: wwinit.c,v 1.7 1998/04/26 22:49:08 millert Exp $ */ /* $NetBSD: wwinit.c,v 1.11 1996/02/08 21:49:07 mycroft Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)wwinit.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: wwinit.c,v 1.6 1997/02/25 01:18:27 downsj Exp $"; +static char rcsid[] = "$OpenBSD: wwinit.c,v 1.7 1998/04/26 22:49:08 millert Exp $"; #endif #endif /* not lint */ @@ -221,7 +221,7 @@ wwinit() else if (wwavailmodes & WWM_UL) wwcursormodes = WWM_UL; - if ((wwib = malloc((unsigned) 512)) == 0) + if ((wwib = malloc(512)) == 0) goto bad; wwibe = wwib + 512; wwibq = wwibp = wwib; @@ -254,7 +254,7 @@ wwinit() goto bad; } - wwtouched = malloc((unsigned) wwnrow); + wwtouched = malloc(wwnrow); if (wwtouched == 0) { wwerrno = WWE_NOMEM; goto bad; @@ -262,7 +262,7 @@ wwinit() for (i = 0; i < wwnrow; i++) wwtouched[i] = 0; - wwupd = (struct ww_update *) malloc((unsigned) wwnrow * sizeof *wwupd); + wwupd = (struct ww_update *) malloc(wwnrow * sizeof *wwupd); if (wwupd == 0) { wwerrno = WWE_NOMEM; goto bad; diff --git a/usr.bin/window/wwiomux.c b/usr.bin/window/wwiomux.c index e3b7a6281ad..e48a2a4574d 100644 --- a/usr.bin/window/wwiomux.c +++ b/usr.bin/window/wwiomux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwiomux.c,v 1.5 1997/02/25 00:04:57 downsj Exp $ */ +/* $OpenBSD: wwiomux.c,v 1.6 1998/04/26 22:49:01 millert Exp $ */ /* $NetBSD: wwiomux.c,v 1.5 1996/02/08 20:45:09 mycroft Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)wwiomux.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: wwiomux.c,v 1.5 1997/02/25 00:04:57 downsj Exp $"; +static char rcsid[] = "$OpenBSD: wwiomux.c,v 1.6 1998/04/26 22:49:01 millert Exp $"; #endif #endif /* not lint */ @@ -52,6 +52,7 @@ static char rcsid[] = "$OpenBSD: wwiomux.c,v 1.5 1997/02/25 00:04:57 downsj Exp #include <sys/ioctl.h> #endif #include <fcntl.h> +#include <string.h> /* * Multiple window output handler. diff --git a/usr.bin/window/wwopen.c b/usr.bin/window/wwopen.c index d128b158572..16f89184076 100644 --- a/usr.bin/window/wwopen.c +++ b/usr.bin/window/wwopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwopen.c,v 1.5 1997/02/25 00:05:00 downsj Exp $ */ +/* $OpenBSD: wwopen.c,v 1.6 1998/04/26 22:49:09 millert Exp $ */ /* $NetBSD: wwopen.c,v 1.6 1996/02/08 21:08:04 mycroft Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)wwopen.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: wwopen.c,v 1.5 1997/02/25 00:05:00 downsj Exp $"; +static char rcsid[] = "$OpenBSD: wwopen.c,v 1.6 1998/04/26 22:49:09 millert Exp $"; #endif #endif /* not lint */ @@ -168,7 +168,7 @@ wwopen(type, oflags, nrow, ncol, row, col, nline) for (j = w->ww_b.l; j < w->ww_b.r; j++) w->ww_buf[i][j].c_w = ' '; - w->ww_nvis = (short *)malloc((unsigned) w->ww_w.nr * sizeof (short)); + w->ww_nvis = (short *)malloc(w->ww_w.nr * sizeof (short)); if (w->ww_nvis == 0) { wwerrno = WWE_NOMEM; goto bad; diff --git a/usr.bin/window/wwpty.c b/usr.bin/window/wwpty.c index 1ea5ea67747..bd7f77a18de 100644 --- a/usr.bin/window/wwpty.c +++ b/usr.bin/window/wwpty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwpty.c,v 1.3 1997/02/25 00:05:02 downsj Exp $ */ +/* $OpenBSD: wwpty.c,v 1.4 1998/04/26 22:49:00 millert Exp $ */ /* $NetBSD: wwpty.c,v 1.3 1995/09/28 10:35:45 tls Exp $ */ /* @@ -41,11 +41,12 @@ #if 0 static char sccsid[] = "@(#)wwpty.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: wwpty.c,v 1.3 1997/02/25 00:05:02 downsj Exp $"; +static char rcsid[] = "$OpenBSD: wwpty.c,v 1.4 1998/04/26 22:49:00 millert Exp $"; #endif #endif /* not lint */ #include "ww.h" +#include <string.h> #include <fcntl.h> #if !defined(OLD_TTY) && !defined(TIOCPKT) #include <sys/ioctl.h> diff --git a/usr.bin/window/wwsize.c b/usr.bin/window/wwsize.c index 8c3781bd6b8..6c25cb78093 100644 --- a/usr.bin/window/wwsize.c +++ b/usr.bin/window/wwsize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwsize.c,v 1.5 1997/02/25 00:05:08 downsj Exp $ */ +/* $OpenBSD: wwsize.c,v 1.6 1998/04/26 22:49:02 millert Exp $ */ /* $NetBSD: wwsize.c,v 1.5 1996/02/08 20:45:11 mycroft Exp $ */ /* @@ -41,10 +41,11 @@ #if 0 static char sccsid[] = "@(#)wwsize.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: wwsize.c,v 1.5 1997/02/25 00:05:08 downsj Exp $"; +static char rcsid[] = "$OpenBSD: wwsize.c,v 1.6 1998/04/26 22:49:02 millert Exp $"; #endif #endif /* not lint */ +#include <stdlib.h> #include "ww.h" /* @@ -79,7 +80,7 @@ register struct ww *w; if (buf == 0) goto bad; } - nvis = (short *)malloc((unsigned) nrow * sizeof (short)); + nvis = (short *)malloc(nrow * sizeof (short)); if (nvis == 0) { wwerrno = WWE_NOMEM; goto bad; diff --git a/usr.bin/window/xx.c b/usr.bin/window/xx.c index 5c6634b9727..97f6653e795 100644 --- a/usr.bin/window/xx.c +++ b/usr.bin/window/xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xx.c,v 1.3 1997/02/25 00:05:15 downsj Exp $ */ +/* $OpenBSD: xx.c,v 1.4 1998/04/26 22:49:10 millert Exp $ */ /* $NetBSD: xx.c,v 1.3 1995/09/28 10:36:03 tls Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)xx.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: xx.c,v 1.3 1997/02/25 00:05:15 downsj Exp $"; +static char rcsid[] = "$OpenBSD: xx.c,v 1.4 1998/04/26 22:49:10 millert Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ xxinit() /* ccinit may choose to change xxbufsize */ if (tt.tt_ntoken > 0 && ccinit() < 0) return -1; - xxbuf = malloc((unsigned) xxbufsize * sizeof *xxbuf); + xxbuf = malloc(xxbufsize * sizeof *xxbuf); if (xxbuf == 0) { wwerrno = WWE_NOMEM; return -1; @@ -121,7 +121,7 @@ xxalloc() abort(); if ((xp = xx_freelist) == 0) /* XXX can't deal with failure */ - xp = (struct xx *) malloc((unsigned) sizeof *xp); + xp = (struct xx *) malloc(sizeof *xp); else xx_freelist = xp->link; if (xx_head == 0) |