summaryrefslogtreecommitdiff
path: root/bin/csh
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-12-14 12:18:28 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-12-14 12:18:28 +0000
commit28e461d672204f54b8eb68a590d36c23a32f9574 (patch)
tree3e3c51ee95dec9ad261710930b40e4426389cbb8 /bin/csh
parentfb3035e3379d9258753316427b03a4d8d0676d07 (diff)
-Wall'ing.
Diffstat (limited to 'bin/csh')
-rw-r--r--bin/csh/alloc.c6
-rw-r--r--bin/csh/printf.c28
-rw-r--r--bin/csh/proc.c7
-rw-r--r--bin/csh/time.c6
4 files changed, 15 insertions, 32 deletions
diff --git a/bin/csh/alloc.c b/bin/csh/alloc.c
index 1b3bc03f77a..a35927a8833 100644
--- a/bin/csh/alloc.c
+++ b/bin/csh/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.2 1996/06/23 14:19:12 deraadt Exp $ */
+/* $OpenBSD: alloc.c,v 1.3 1996/12/14 12:17:40 mickey Exp $ */
/* $NetBSD: alloc.c,v 1.6 1995/03/21 09:02:23 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)alloc.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: alloc.c,v 1.2 1996/06/23 14:19:12 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: alloc.c,v 1.3 1996/12/14 12:17:40 mickey Exp $";
#endif
#endif /* not lint */
@@ -126,6 +126,6 @@ showall(v, t)
struct command *t;
{
memtop = (char *) sbrk(0);
- (void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%ld).\n",
+ (void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%d).\n",
(unsigned long) membot, (unsigned long) memtop, memtop - membot);
}
diff --git a/bin/csh/printf.c b/bin/csh/printf.c
index a44269b597a..b39ff0a7c44 100644
--- a/bin/csh/printf.c
+++ b/bin/csh/printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printf.c,v 1.4 1996/09/15 22:00:26 millert Exp $ */
+/* $OpenBSD: printf.c,v 1.5 1996/12/14 12:17:41 mickey Exp $ */
/* $NetBSD: printf.c,v 1.6 1995/03/21 09:03:15 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*/
-#if !defined(BUILTIN) && !defined(SHELL)
+#if !defined(BUILTIN)
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
@@ -46,36 +46,18 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)printf.c 8.1 (Berkeley) 7/20/93";
#else
-static char rcsid[] = "$OpenBSD: printf.c,v 1.4 1996/09/15 22:00:26 millert Exp $";
+static char rcsid[] = "$OpenBSD: printf.c,v 1.5 1996/12/14 12:17:41 mickey Exp $";
#endif
#endif /* not lint */
#include <sys/types.h>
-#include <err.h>
#include <errno.h>
#include <limits.h>
-#ifdef SHELL
-#define EOF -1
-#else
#include <stdio.h>
-#endif
#include <stdlib.h>
#include <string.h>
-
-/*
- * XXX
- * This *has* to go away. TK.
- */
-#ifdef SHELL
-#define main printfcmd
-#define warnx(a, b, c) { \
- char buf[64]; \
- (void)snprintf(buf, sizeof(buf), a, b, c); \
- error(buf); \
-}
-#include "../../bin/sh/bltin/bltin.h"
-#endif
+#include <err.h>
#define PF(f, func) { \
if (fieldwidth) \
@@ -264,7 +246,7 @@ escape(fmt)
register char *store;
register int value, c;
- for (store = fmt; c = *fmt; ++fmt, ++store) {
+ for (store = fmt; (c = *fmt) != 0; ++fmt, ++store) {
if (c != '\\') {
*store = c;
continue;
diff --git a/bin/csh/proc.c b/bin/csh/proc.c
index 200d59e1963..da53e3b325c 100644
--- a/bin/csh/proc.c
+++ b/bin/csh/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.2 1996/06/23 14:19:28 deraadt Exp $ */
+/* $OpenBSD: proc.c,v 1.3 1996/12/14 12:17:42 mickey Exp $ */
/* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: proc.c,v 1.2 1996/06/23 14:19:28 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: proc.c,v 1.3 1996/12/14 12:17:42 mickey Exp $";
#endif
#endif /* not lint */
@@ -53,6 +53,7 @@ static char rcsid[] = "$OpenBSD: proc.c,v 1.2 1996/06/23 14:19:28 deraadt Exp $"
#else
# include <varargs.h>
#endif
+#include <err.h>
#include "csh.h"
#include "dir.h"
@@ -1190,7 +1191,7 @@ pfind(cp)
}
if (np)
return (np);
- stderror(ERR_NAME | cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB);
+ stderror(ERR_NAME | (cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB));
/* NOTREACHED */
return (0);
}
diff --git a/bin/csh/time.c b/bin/csh/time.c
index fb5855909ac..c70fc4c7fa7 100644
--- a/bin/csh/time.c
+++ b/bin/csh/time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.c,v 1.2 1996/06/23 14:19:31 deraadt Exp $ */
+/* $OpenBSD: time.c,v 1.3 1996/12/14 12:17:44 mickey Exp $ */
/* $NetBSD: time.c,v 1.7 1995/03/21 13:55:25 mycroft Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: time.c,v 1.2 1996/06/23 14:19:31 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: time.c,v 1.3 1996/12/14 12:17:44 mickey Exp $";
#endif
#endif /* not lint */
@@ -251,7 +251,7 @@ pdeltat(t1, t0)
struct timeval td;
timersub(t1, t0, &td);
- (void) fprintf(cshout, "%d.%01d", td.tv_sec, td.tv_usec / 100000);
+ (void) fprintf(cshout, "%ld.%01ld", td.tv_sec, td.tv_usec / 100000);
}
#define P2DIG(i) (void) fprintf(cshout, "%d%d", (i) / 10, (i) % 10)