summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-08-24 21:25:49 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-08-24 21:25:49 +0000
commit44a5e689b337d146e897066765ed3ecd5e930e2d (patch)
tree182a9993a4d7330ecc33ca8587b9017afb8b6729 /lib/libc
parenta98541c495b83b039b265d44eafe0e9bcc5d36cf (diff)
Fix compiler warnings.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getbsize.c8
-rw-r--r--lib/libc/gen/initgroups.c3
-rw-r--r--lib/libc/gen/popen.c6
-rw-r--r--lib/libc/gen/sysctl.c10
-rw-r--r--lib/libc/hash/rmd160.c7
-rw-r--r--lib/libc/net/ns_ntoa.c4
6 files changed, 25 insertions, 13 deletions
diff --git a/lib/libc/gen/getbsize.c b/lib/libc/gen/getbsize.c
index b622bf32fe4..f3fbece28ff 100644
--- a/lib/libc/gen/getbsize.c
+++ b/lib/libc/gen/getbsize.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getbsize.c,v 1.4 1997/07/09 00:28:19 millert Exp $";
+static char rcsid[] = "$OpenBSD: getbsize.c,v 1.5 1997/08/24 21:25:45 millert Exp $";
#endif /* not lint */
#include <err.h>
@@ -49,9 +49,9 @@ getbsize(headerlenp, blocksizep)
long n, max, mul, blocksize;
char *ep, *p, *form;
-#define KB (1024L)
-#define MB (1024L * 1024L)
-#define GB (1024L * 1024L * 1024L)
+#define KB (1024)
+#define MB (1024 * 1024)
+#define GB (1024 * 1024 * 1024)
#define MAXB GB /* No tera, peta, nor exa. */
form = "";
if ((p = getenv("BLOCKSIZE")) != NULL && *p != '\0') {
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
index af95e03e8c4..179781e8726 100644
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -32,11 +32,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: initgroups.c,v 1.3 1996/08/19 08:24:24 tholo Exp $";
+static char rcsid[] = "$OpenBSD: initgroups.c,v 1.4 1997/08/24 21:25:46 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
+#include <err.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c
index 9372d0ebf89..21dac231b59 100644
--- a/lib/libc/gen/popen.c
+++ b/lib/libc/gen/popen.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: popen.c,v 1.7 1997/07/09 00:28:23 millert Exp $";
+static char rcsid[] = "$OpenBSD: popen.c,v 1.8 1997/08/24 21:25:46 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -64,6 +64,10 @@ popen(program, type)
FILE *iop;
int pdes[2], pid;
+#ifdef __GNUC__
+ (void)&cur;
+#endif
+
if ((*type != 'r' && *type != 'w') || type[1] != '\0') {
errno = EINVAL;
return (NULL);
diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c
index bcefdef0c49..02fbf85befa 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sysctl.c,v 1.2 1996/08/19 08:26:28 tholo Exp $";
+static char rcsid[] = "$OpenBSD: sysctl.c,v 1.3 1997/08/24 21:25:46 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -45,12 +45,16 @@ static char rcsid[] = "$OpenBSD: sysctl.c,v 1.2 1996/08/19 08:26:28 tholo Exp $"
#include <string.h>
#include <unistd.h>
+int __sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
+
int
sysctl(name, namelen, oldp, oldlenp, newp, newlen)
int *name;
u_int namelen;
- void *oldp, *newp;
- size_t *oldlenp, newlen;
+ void *oldp;
+ size_t *oldlenp;
+ void *newp;
+ size_t newlen;
{
if (name[0] != CTL_USER)
return (__sysctl(name, namelen, oldp, oldlenp, newp, newlen));
diff --git a/lib/libc/hash/rmd160.c b/lib/libc/hash/rmd160.c
index 8e5afe21d98..713fb836a69 100644
--- a/lib/libc/hash/rmd160.c
+++ b/lib/libc/hash/rmd160.c
@@ -318,8 +318,11 @@ void RMD160Update(context, data, nbytes)
const u_char *data;
u_int32_t nbytes;
{
- u_int32_t i, j, X[16];
-
+ u_int32_t X[16];
+ u_int32_t i;
+#if BYTE_ORDER != LITTLE_ENDIAN
+ u_int32_t j;
+#endif
(void)memset(X, 0, sizeof(X));
/* process all complete blocks */
diff --git a/lib/libc/net/ns_ntoa.c b/lib/libc/net/ns_ntoa.c
index ec03ba0dee2..c33f7109669 100644
--- a/lib/libc/net/ns_ntoa.c
+++ b/lib/libc/net/ns_ntoa.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ns_ntoa.c,v 1.6 1997/07/21 20:31:06 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ns_ntoa.c,v 1.7 1997/08/24 21:25:48 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -54,7 +54,7 @@ ns_ntoa(addr)
u_char *uplim = up + 6;
net.net_e = addr.x_net;
- sprintf(obuf, "%lx", ntohl(net.long_e));
+ sprintf(obuf, "%x", ntohl(net.long_e));
cp = spectHex(obuf);
cp2 = cp + 1;
while (*up==0 && up < uplim) up++;