Removed a whole herd of unused variables.

Some other cleanup.
This commit is contained in:
Kees van Reeuwijk 2010-01-14 13:53:12 +00:00
parent 9d247900c0
commit 5459f3a607
17 changed files with 16 additions and 58 deletions

View file

@ -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;

View file

@ -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++) {

View file

@ -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 <stdlib.h>
@ -13,7 +11,6 @@ Copyright 1995 Philip Homburg
#include "generic/assert.h"
#include "generic/buf.h"
#include "generic/type.h"
THIS_FILE

View file

@ -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);
}

View file

@ -14,7 +14,6 @@ Copyright 1995 Philip Homburg
#include "event.h"
#include "eth.h"
#include "io.h"
#include "sr.h"
THIS_FILE

View file

@ -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);

View file

@ -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)
{

View file

@ -387,7 +387,6 @@ int priority;
{
for (i= 0, ip_ass= ip_ass_table; i<IP_ASS_NR; i++, ip_ass++)
{
next_pack= ip_ass->ia_frags;
while(ip_ass->ia_frags != NULL)
{
pack= ip_ass->ia_frags;

View file

@ -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,

View file

@ -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;

View file

@ -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];

View file

@ -47,7 +47,6 @@ from DL_ETH:
#define _MINIX_SOURCE 1
#include <fcntl.h>
#include <time.h>
#include <unistd.h>
#include <sys/svrctl.h>
#include <minix/ds.h>

View file

@ -6,7 +6,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <minix3/queryparam.h>
#if EXAMPLE

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;