Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Fix signed/unsigned warnings.
details: https://anonhg.NetBSD.org/src/rev/f14920ace697
branches: trunk
changeset: 551191:f14920ace697
user: fvdl <fvdl%NetBSD.org@localhost>
date: Sun Aug 31 22:40:13 2003 +0000
description:
Fix signed/unsigned warnings.
diffstat:
sys/arch/i386/stand/dosboot/devopen.c | 4 ++--
sys/arch/i386/stand/dosboot/main.c | 4 ++--
sys/arch/i386/stand/lib/dosfile.c | 4 ++--
sys/arch/i386/stand/lib/netif/3c509.c | 4 ++--
sys/arch/i386/stand/lib/netif/3c590.c | 4 ++--
sys/arch/i386/stand/lib/netif/3c90xb.c | 4 ++--
sys/arch/i386/stand/lib/netif/etherdrv.h | 4 ++--
sys/arch/i386/stand/libsa/nfs.c | 10 +++++-----
sys/lib/libsa/arp.c | 4 ++--
sys/lib/libsa/bootp.c | 4 ++--
sys/lib/libsa/dosfs.c | 6 +++---
sys/lib/libsa/ether.c | 6 +++---
sys/lib/libsa/exec.c | 10 +++++-----
sys/lib/libsa/ffsv1.c | 4 ++--
sys/lib/libsa/ffsv2.c | 4 ++--
sys/lib/libsa/loadfile_aout.c | 9 +++++----
sys/lib/libsa/loadfile_elf32.c | 10 +++++-----
sys/lib/libsa/net.c | 4 ++--
sys/lib/libsa/nfs.c | 16 ++++++++--------
sys/lib/libsa/rarp.c | 4 ++--
sys/lib/libsa/rpc.c | 6 +++---
sys/lib/libsa/tftp.c | 7 ++++---
sys/lib/libsa/udp.c | 6 +++---
sys/lib/libsa/ufs.c | 21 +++++++++++----------
sys/lib/libsa/ustarfs.c | 9 +++++----
sys/lib/libz/inftrees.c | 4 ++--
26 files changed, 88 insertions(+), 84 deletions(-)
diffs (truncated from 739 to 300 lines):
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/dosboot/devopen.c
--- a/sys/arch/i386/stand/dosboot/devopen.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/dosboot/devopen.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: devopen.c,v 1.5 2001/06/01 23:26:31 jdolecek Exp $ */
+/* $NetBSD: devopen.c,v 1.6 2003/08/31 22:40:13 fvdl Exp $ */
/*
* Copyright (c) 1996
@@ -85,7 +85,7 @@
unsigned int unit;
int *biosdev;
{
- int i;
+ unsigned i;
for (i = 0; i < NUMBIOSDEVS; i++)
if (!strcmp(devname, biosdevtab[i].name)) {
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/dosboot/main.c
--- a/sys/arch/i386/stand/dosboot/main.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/dosboot/main.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.18 2001/07/05 00:58:45 itojun Exp $ */
+/* $NetBSD: main.c,v 1.19 2003/08/31 22:40:13 fvdl Exp $ */
/*
* Copyright (c) 1996, 1997
@@ -228,7 +228,7 @@
* xmsmem is a few kB less than the actual size, but
* better than nothing.
*/
- if (xmsmem > extmem)
+ if ((int)xmsmem > extmem)
extmem = xmsmem;
s = "(xms) ";
}
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/lib/dosfile.c
--- a/sys/arch/i386/stand/lib/dosfile.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/lib/dosfile.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dosfile.c,v 1.8 2003/08/18 15:47:41 dsl Exp $ */
+/* $NetBSD: dosfile.c,v 1.9 2003/08/31 22:40:14 fvdl Exp $ */
/*
* Copyright (c) 1996
@@ -123,7 +123,7 @@
while (lsize > 0) {
u_int tsize;
- int tgot;
+ size_t tgot;
tsize = lsize;
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/lib/netif/3c509.c
--- a/sys/arch/i386/stand/lib/netif/3c509.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/lib/netif/3c509.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: 3c509.c,v 1.6 1999/02/19 19:30:46 drochner Exp $ */
+/* $NetBSD: 3c509.c,v 1.7 2003/08/31 22:40:14 fvdl Exp $ */
/* stripped down from freebsd:sys/i386/netboot/3c509.c */
@@ -40,7 +40,7 @@
#include "etherdrv.h"
#include "3c509.h"
-int ether_medium;
+unsigned ether_medium;
unsigned short eth_base;
extern void epreset __P((void));
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/lib/netif/3c590.c
--- a/sys/arch/i386/stand/lib/netif/3c590.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/lib/netif/3c590.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: 3c590.c,v 1.11 1999/11/05 22:57:39 drochner Exp $ */
+/* $NetBSD: 3c590.c,v 1.12 2003/08/31 22:40:14 fvdl Exp $ */
/* stripped down from freebsd:sys/i386/netboot/3c509.c */
@@ -46,7 +46,7 @@
#define EP_W3_INTERNAL_CONFIG 0x00 /* 32 bits */
#define EP_W3_RESET_OPTIONS 0x08 /* 16 bits */
-int ether_medium;
+unsigned ether_medium;
unsigned short eth_base;
extern void epreset __P((void));
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/lib/netif/3c90xb.c
--- a/sys/arch/i386/stand/lib/netif/3c90xb.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/lib/netif/3c90xb.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: 3c90xb.c,v 1.8 2002/02/19 20:38:28 thorpej Exp $ */
+/* $NetBSD: 3c90xb.c,v 1.9 2003/08/31 22:40:14 fvdl Exp $ */
/*
* Copyright (c) 1999
@@ -89,7 +89,7 @@
static int iobase;
static u_char myethaddr[6];
-int ether_medium;
+unsigned ether_medium;
static struct {
int did;
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/lib/netif/etherdrv.h
--- a/sys/arch/i386/stand/lib/netif/etherdrv.h Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/lib/netif/etherdrv.h Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: etherdrv.h,v 1.5 1999/12/02 13:20:56 drochner Exp $ */
+/* $NetBSD: etherdrv.h,v 1.6 2003/08/31 22:40:15 fvdl Exp $ */
/*
* Copyright (c) 1996
@@ -37,7 +37,7 @@
int EtherReceive __P((char *, int));
void EtherStop __P((void));
-extern int ether_medium;
+extern unsigned ether_medium;
#define ETHERMEDIUM_BNC 0
#define ETHERMEDIUM_UTP 1
#define ETHERMEDIUM_AUI 2
diff -r 3664d471301b -r f14920ace697 sys/arch/i386/stand/libsa/nfs.c
--- a/sys/arch/i386/stand/libsa/nfs.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/arch/i386/stand/libsa/nfs.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs.c,v 1.7 2003/08/18 15:47:43 dsl Exp $ */
+/* $NetBSD: nfs.c,v 1.8 2003/08/31 22:40:15 fvdl Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@@ -118,7 +118,7 @@
char *path;
u_char *fhp;
{
- int len;
+ size_t len;
struct args {
n_long len;
char path[FNAME_SIZE];
@@ -135,7 +135,7 @@
n_long h[RPC_HEADER_WORDS];
struct repl d;
} rdata;
- size_t cc;
+ ssize_t cc;
#ifdef NFS_DEBUG
if (debug)
@@ -209,7 +209,7 @@
memset(args, 0, sizeof(*args));
memcpy(args->fh, d->fh, sizeof(args->fh));
- if (len > sizeof(args->name))
+ if ((size_t)len > sizeof(args->name))
len = sizeof(args->name);
memcpy(args->name, name, len);
args->len = htonl(len);
@@ -301,7 +301,7 @@
n_long h[RPC_HEADER_WORDS];
struct nfs_read_repl d;
} rdata;
- size_t cc;
+ ssize_t cc;
long x;
int hlen, rlen;
diff -r 3664d471301b -r f14920ace697 sys/lib/libsa/arp.c
--- a/sys/lib/libsa/arp.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/lib/libsa/arp.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arp.c,v 1.23 2002/09/27 15:37:48 provos Exp $ */
+/* $NetBSD: arp.c,v 1.24 2003/08/31 22:40:47 fvdl Exp $ */
/*
* Copyright (c) 1992 Regents of the University of California.
@@ -208,7 +208,7 @@
n = readether(d, pkt, len, tleft, &etype);
errno = 0; /* XXX */
- if (n == -1 || n < sizeof(struct ether_arp)) {
+ if (n == -1 || (size_t)n < sizeof(struct ether_arp)) {
#ifdef ARP_DEBUG
if (debug)
printf("bad len=%ld\n", (signed long) n);
diff -r 3664d471301b -r f14920ace697 sys/lib/libsa/bootp.c
--- a/sys/lib/libsa/bootp.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/lib/libsa/bootp.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bootp.c,v 1.24 2003/03/12 14:51:31 drochner Exp $ */
+/* $NetBSD: bootp.c,v 1.25 2003/08/31 22:40:47 fvdl Exp $ */
/*
* Copyright (c) 1992 Regents of the University of California.
@@ -306,7 +306,7 @@
#endif
n = readudp(d, pkt, len, tleft);
- if (n == -1 || n < sizeof(struct bootp) - BOOTP_VENDSIZE)
+ if (n == -1 || (size_t)n < sizeof(struct bootp) - BOOTP_VENDSIZE)
goto bad;
bp = (struct bootp *)pkt;
diff -r 3664d471301b -r f14920ace697 sys/lib/libsa/dosfs.c
--- a/sys/lib/libsa/dosfs.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/lib/libsa/dosfs.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dosfs.c,v 1.7 2003/08/18 15:45:27 dsl Exp $ */
+/* $NetBSD: dosfs.c,v 1.8 2003/08/31 22:40:48 fvdl Exp $ */
/*
* Copyright (c) 1996, 1998 Robert Nordier
@@ -132,9 +132,9 @@
#define okclus(fs, c) ((c) >= LOCLUS && (c) <= (fs)->xclus)
/* Get start cluster from directory entry */
-#define stclus(sz, de) ((sz) != 32 ? getushort((de)->deStartCluster) : \
+#define stclus(sz, de) ((sz) != 32 ? (u_int)getushort((de)->deStartCluster) : \
((u_int)getushort((de)->deHighClust) << 16) | \
- getushort((de)->deStartCluster))
+ (u_int)getushort((de)->deStartCluster))
static int dosunmount(DOS_FS *);
static int parsebs(DOS_FS *, DOS_BS *);
diff -r 3664d471301b -r f14920ace697 sys/lib/libsa/ether.c
--- a/sys/lib/libsa/ether.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/lib/libsa/ether.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ether.c,v 1.17 2003/03/12 16:46:31 drochner Exp $ */
+/* $NetBSD: ether.c,v 1.18 2003/08/31 22:40:48 fvdl Exp $ */
/*
* Copyright (c) 1992 Regents of the University of California.
@@ -81,7 +81,7 @@
eh->ether_type = htons(etype);
n = netif_put(d, eh, len);
- if (n == -1 || n < sizeof(*eh))
+ if (n == -1 || (size_t)n < sizeof(*eh))
return (-1);
n -= sizeof(*eh);
@@ -113,7 +113,7 @@
len += sizeof(*eh);
n = netif_get(d, eh, len, tleft);
- if (n == -1 || n < sizeof(*eh))
+ if (n == -1 || (size_t)n < sizeof(*eh))
return (-1);
/* Validate Ethernet address. */
diff -r 3664d471301b -r f14920ace697 sys/lib/libsa/exec.c
--- a/sys/lib/libsa/exec.c Sun Aug 31 21:52:01 2003 +0000
+++ b/sys/lib/libsa/exec.c Sun Aug 31 22:40:13 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.22 2003/08/07 16:32:27 agc Exp $ */
+/* $NetBSD: exec.c,v 1.23 2003/08/31 22:40:48 fvdl Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@@ -88,7 +88,7 @@
addr += sizeof(x);
x.a_text -= sizeof(x);
}
- if (read(io, (char *)addr, x.a_text) != x.a_text)
+ if (read(io, (char *)addr, x.a_text) != (ssize_t)x.a_text)
goto shread;
addr += x.a_text;
if (N_GETMAGIC(x) == ZMAGIC || N_GETMAGIC(x) == NMAGIC)
@@ -97,13 +97,13 @@
/* Data */
printf("+%ld", x.a_data);
- if (read(io, addr, x.a_data) != x.a_data)
+ if (read(io, addr, x.a_data) != (ssize_t)x.a_data)
goto shread;
addr += x.a_data;
/* Bss */
printf("+%ld", x.a_bss);
- for (i = 0; i < x.a_bss; i++)
+ for (i = 0; i < (int)x.a_bss; i++)
*addr++ = 0;
/* Symbols */
@@ -112,7 +112,7 @@
addr += sizeof(x.a_syms);
if (x.a_syms) {
printf("+[%ld", x.a_syms);
- if (read(io, addr, x.a_syms) != x.a_syms)
+ if (read(io, addr, x.a_syms) != (ssize_t)x.a_syms)
goto shread;
addr += x.a_syms;
}
diff -r 3664d471301b -r f14920ace697 sys/lib/libsa/ffsv1.c
--- a/sys/lib/libsa/ffsv1.c Sun Aug 31 21:52:01 2003 +0000
Home |
Main Index |
Thread Index |
Old Index