From: Kees van Reeuwijk Date: Thu, 14 Jan 2010 13:53:12 +0000 (+0000) Subject: Removed a whole herd of unused variables. X-Git-Tag: v3.1.6~82 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=5459f3a607c16e55ad4063730b302746b9b5e136;p=minix.git Removed a whole herd of unused variables. Some other cleanup. --- diff --git a/servers/ds/main.c b/servers/ds/main.c index 6dcacd1d8..655e1f7c2 100644 --- a/servers/ds/main.c +++ b/servers/ds/main.c @@ -38,7 +38,6 @@ PUBLIC int main(int argc, char **argv) */ message m; int result; - sigset_t sigset; /* SEF local startup. */ env_setargs(argc, argv); @@ -118,7 +117,6 @@ PRIVATE void sig_handler() { /* Signal handler. */ sigset_t sigset; - int sig; /* Try to obtain signal set from PM. */ if (getsigset(&sigset) != 0) return; diff --git a/servers/ds/store.c b/servers/ds/store.c index 6fc06f3ae..a150e97ab 100644 --- a/servers/ds/store.c +++ b/servers/ds/store.c @@ -262,7 +262,6 @@ message *m_ptr; /* request message */ * created or updated) matching that subscription. Return * a message and copy the key and value for every one. */ - struct data_store *dsp; int r, s, d, type = m_ptr->DS_FLAGS & DS_TYPE_MASK; if(!type) return EINVAL; for(s = 0; s < NR_DS_SUBS; s++) { diff --git a/servers/inet/buf.c b/servers/inet/buf.c index 27d8e32d0..a349c0e19 100644 --- a/servers/inet/buf.c +++ b/servers/inet/buf.c @@ -4,8 +4,6 @@ This file contains routines for buffer management. Copyright 1995 Philip Homburg */ -#define BUF_IMPLEMENTATION 1 /* Avoid some macros */ - #include "inet.h" #include @@ -13,7 +11,6 @@ Copyright 1995 Philip Homburg #include "generic/assert.h" #include "generic/buf.h" -#include "generic/type.h" THIS_FILE diff --git a/servers/inet/clock.c b/servers/inet/clock.c index 02acdc862..73f026c78 100644 --- a/servers/inet/clock.c +++ b/servers/inet/clock.c @@ -9,7 +9,6 @@ Copyright 1995 Philip Homburg #include "generic/assert.h" #include "generic/buf.h" #include "generic/clock.h" -#include "generic/type.h" THIS_FILE @@ -25,8 +24,6 @@ FORWARD _PROTOTYPE( void set_timer, (void) ); PUBLIC void clck_init() { - int r; - clck_call_expire= 0; curr_time= 0; prev_time= 0; @@ -38,8 +35,7 @@ PUBLIC time_t get_time() { if (!curr_time) { - int s; - if ((s=getuptime(&curr_time)) != OK) + if (getuptime(&curr_time) != OK) ip_panic(("can't read clock")); assert(curr_time >= prev_time); } diff --git a/servers/inet/generic/arp.c b/servers/inet/generic/arp.c index 6d9b85b8c..2fa0ec8bf 100644 --- a/servers/inet/generic/arp.c +++ b/servers/inet/generic/arp.c @@ -14,7 +14,6 @@ Copyright 1995 Philip Homburg #include "event.h" #include "eth.h" #include "io.h" -#include "sr.h" THIS_FILE diff --git a/servers/inet/generic/eth.c b/servers/inet/generic/eth.c index fba51879c..b168f0f2b 100644 --- a/servers/inet/generic/eth.c +++ b/servers/inet/generic/eth.c @@ -15,7 +15,6 @@ Copyright 1995 Philip Homburg #include "buf.h" #include "eth.h" #include "eth_int.h" -#include "io.h" #include "sr.h" THIS_FILE @@ -742,10 +741,8 @@ eth_fd_t *eth_fd; unsigned long flags; unsigned int en_di_flags; - eth_port_t *eth_port; acc_t *pack; - eth_port= eth_fd->ef_port; flags= eth_fd->ef_ethopt.nweo_flags; en_di_flags= (flags >>16) | (flags & 0xffff); diff --git a/servers/inet/generic/icmp.c b/servers/inet/generic/icmp.c index a24507b16..b4ea2b990 100644 --- a/servers/inet/generic/icmp.c +++ b/servers/inet/generic/icmp.c @@ -672,7 +672,6 @@ acc_t *reply_ip_hdr; if (r == -1) { bf_afree(reply_ip_hdr); - reply_ip_hdr= NULL; return; } @@ -1118,7 +1117,7 @@ icmp_hdr_t **icmp_hdr_pp; acc_t *ip_pack, *icmp_pack, *tmp_pack; int ip_hdr_len, icmp_hdr_len, ih_type; size_t size, pack_len; - ipaddr_t dest, netmask; + ipaddr_t dest; nettype_t nettype; pack= bf_packIffLess(pack, IP_MIN_HDR_SIZE); @@ -1163,7 +1162,6 @@ icmp_hdr_t **icmp_hdr_pp; } dest= ip_hdr->ih_src; nettype= ip_nettype(dest); - netmask= ip_netmask(nettype); if (nettype != IPNT_CLASS_A && nettype != IPNT_LOCAL && nettype != IPNT_CLASS_B && nettype != IPNT_CLASS_C) { diff --git a/servers/inet/generic/ip.c b/servers/inet/generic/ip.c index 11771c987..193be4df6 100644 --- a/servers/inet/generic/ip.c +++ b/servers/inet/generic/ip.c @@ -387,7 +387,6 @@ int priority; { for (i= 0, ip_ass= ip_ass_table; iia_frags; while(ip_ass->ia_frags != NULL) { pack= ip_ass->ia_frags; diff --git a/servers/inet/generic/ip_eth.c b/servers/inet/generic/ip_eth.c index aa0b51212..3767bc57b 100644 --- a/servers/inet/generic/ip_eth.c +++ b/servers/inet/generic/ip_eth.c @@ -272,7 +272,7 @@ int type; size_t pack_size; eth_hdr_t *eth_hdr; xmit_hdr_t *xmit_hdr; - ipaddr_t hostpart, tmpaddr; + ipaddr_t tmpaddr; time_t t; u32_t *p; @@ -321,7 +321,6 @@ int type; ip_panic(( "invalid destination" )); } - hostpart= (dest & ~ip_port->ip_subnetmask); assert(dest != ip_port->ip_ipaddr); r= arp_ip_eth(ip_port->ip_dl.dl_eth.de_port, diff --git a/servers/inet/generic/ip_ioctl.c b/servers/inet/generic/ip_ioctl.c index 1920b9feb..3099054b3 100644 --- a/servers/inet/generic/ip_ioctl.c +++ b/servers/inet/generic/ip_ioctl.c @@ -504,7 +504,7 @@ PUBLIC int ip_setconf(ip_port_nr, ipconf) int ip_port_nr; nwio_ipconf_t *ipconf; { - int i, old_ip_flags, do_report; + int i, do_report; ip_port_t *ip_port; ip_fd_t *ip_fd; ipaddr_t ipaddr; @@ -512,8 +512,6 @@ nwio_ipconf_t *ipconf; ip_port= &ip_port_table[ip_port_nr]; - old_ip_flags= ip_port->ip_flags; - if (ipconf->nwic_flags & ~NWIC_FLAGS) return EBADMODE; diff --git a/servers/inet/generic/tcp.c b/servers/inet/generic/tcp.c index f03ddc6b1..976bbfeca 100644 --- a/servers/inet/generic/tcp.c +++ b/servers/inet/generic/tcp.c @@ -20,8 +20,6 @@ Copyright 1995 Philip Homburg THIS_FILE -#define NOT_IMPLEMENTED 0 - PUBLIC tcp_port_t *tcp_port_table; PUBLIC tcp_fd_t tcp_fd_table[TCP_FD_NR]; PUBLIC tcp_conn_t tcp_conn_table[TCP_CONN_NR]; diff --git a/servers/inet/inet.c b/servers/inet/inet.c index d833f6959..93c0fa40a 100644 --- a/servers/inet/inet.c +++ b/servers/inet/inet.c @@ -47,7 +47,6 @@ from DL_ETH: #define _MINIX_SOURCE 1 #include -#include #include #include #include diff --git a/servers/inet/minix3/queryparam.c b/servers/inet/minix3/queryparam.c index d8b37c163..3fb164786 100644 --- a/servers/inet/minix3/queryparam.c +++ b/servers/inet/minix3/queryparam.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #if EXAMPLE diff --git a/servers/inet/mnx_eth.c b/servers/inet/mnx_eth.c index d9262923f..241f659a9 100644 --- a/servers/inet/mnx_eth.c +++ b/servers/inet/mnx_eth.c @@ -219,12 +219,6 @@ PUBLIC void eth_write_port(eth_port, pack) eth_port_t *eth_port; acc_t *pack; { - eth_port_t *loc_port; - message mess1, block_msg; - u8_t *eth_dst_ptr; - int multicast, r; - ev_arg_t ev_arg; - assert(!no_ethWritePort); assert(!eth_port->etp_vlan); @@ -245,8 +239,7 @@ acc_t *pack; PRIVATE int notification_count; #endif -PUBLIC void eth_rec(m) -message *m; +PUBLIC void eth_rec(message *m) { int i, r, m_type, stat; eth_port_t *loc_port, *vlan_port; @@ -487,10 +480,9 @@ message *m; } } -PUBLIC void eth_check_drivers(m) -message *m; +PUBLIC void eth_check_drivers(message *m) { - int i, r, tasknr; + int r, tasknr; tasknr= m->m_source; #if 0 @@ -516,7 +508,6 @@ PUBLIC int eth_get_stat(eth_port, eth_stat) eth_port_t *eth_port; eth_stat_t *eth_stat; { - int r; cp_grant_id_t gid; assert(!eth_port->etp_vlan); @@ -552,7 +543,7 @@ u32_t flags; { int r; unsigned dl_flags, mask; - message mess, repl_mess; + message mess; assert(!eth_port->etp_vlan); @@ -764,11 +755,9 @@ int count; PRIVATE void setup_read(eth_port) eth_port_t *eth_port; { - eth_port_t *loc_port; acc_t *pack, *pack_ptr; - message mess1, block_msg; + message mess1; iovec_s_t *iovec; - ev_arg_t ev_arg; int i, r; assert(!eth_port->etp_vlan); @@ -908,7 +897,7 @@ static void eth_restart(eth_port, tasknr) eth_port_t *eth_port; int tasknr; { - int i, r; + int r; unsigned flags, dl_flags; cp_grant_id_t gid; message mess; diff --git a/servers/inet/qp.c b/servers/inet/qp.c index 9fcc084f6..439097021 100644 --- a/servers/inet/qp.c +++ b/servers/inet/qp.c @@ -157,8 +157,7 @@ PRIVATE int qp_read(fd, count) int fd; size_t count; { - int r, err; - size_t len; + int r; acc_t *pkt; qp_fd_t *qp_fd; @@ -329,7 +328,7 @@ int c; /* Send one character back to the user. */ acc_t *pkt; qp_fd_t *qp_fd; - size_t n, bytes_left; + size_t bytes_left; off_t off; bytes_left= qv->rd_bytes_left; diff --git a/servers/inet/sr.c b/servers/inet/sr.c index 6de2fecc0..b659f130f 100644 --- a/servers/inet/sr.c +++ b/servers/inet/sr.c @@ -459,12 +459,11 @@ message *m; { sr_fd_t *sr_fd; int result; - int proc_nr, ref, operation; + int proc_nr, ref; result=EINTR; proc_nr= m->IO_ENDPT; ref= (int)m->IO_GRANT; - operation= 0; sr_fd= sr_getchannel(m->DEVICE); assert (sr_fd); @@ -496,12 +495,8 @@ PRIVATE int sr_select(m) message *m; { sr_fd_t *sr_fd; - mq_t **q_head_ptr, **q_tail_ptr; - int ip_flag, susp_flag; - int r, ops; + int r; unsigned m_ops, i_ops; - ioreq_t request; - size_t size; sr_fd= sr_getchannel(m->DEVICE); assert (sr_fd); @@ -651,12 +646,11 @@ mq_t *mq; int status; int is_revive; { - int result, proc, ref,operation; + int result, proc, ref; message reply, *mp; proc= mq->mq_mess.IO_ENDPT; ref= (int)mq->mq_mess.IO_GRANT; - operation= mq->mq_mess.m_type; if (is_revive) mp= &mq->mq_mess; diff --git a/servers/init/init.c b/servers/init/init.c index 05c8236c3..af3cb2159 100644 --- a/servers/init/init.c +++ b/servers/init/init.c @@ -209,7 +209,7 @@ void onterm(int sig) void onabrt(int sig) { - static int count; + static int count = 0; if (++count == 2) reboot(RBT_HALT); gotabrt = 1;