Code cleanup unused-but-set-variable spotted by gcc.

Reviewed by:	melifaro
Approved by:	bapt (mentor)
Differential Revision:	D3473
This commit is contained in:
Marcelo Araujo 2015-08-25 15:32:08 +00:00
parent 58458d066f
commit b7684f4b85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287130
3 changed files with 4 additions and 14 deletions

View File

@ -1308,14 +1308,12 @@ print_icmptypes(struct buf_pr *bp, ipfw_insn_u32 *cmd)
static void
print_dscp(struct buf_pr *bp, ipfw_insn_u32 *cmd)
{
int i, c;
int i = 0;
uint32_t *v;
char sep= ' ';
const char *code;
bprintf(bp, " dscp");
i = 0;
c = 0;
v = cmd->d;
while (i < 64) {
if (*v & (1 << i)) {

View File

@ -87,7 +87,7 @@ set_addr_dynamic(const char *ifn, struct nat44_cfg_nat *n)
struct ifa_msghdr *ifam;
struct sockaddr_dl *sdl;
struct sockaddr_in *sin;
int ifIndex, ifMTU;
int ifIndex;
mib[0] = CTL_NET;
mib[1] = PF_ROUTE;
@ -126,7 +126,6 @@ set_addr_dynamic(const char *ifn, struct nat44_cfg_nat *n)
if (strlen(ifn) == sdl->sdl_nlen &&
strncmp(ifn, sdl->sdl_data, sdl->sdl_nlen) == 0) {
ifIndex = ifm->ifm_index;
ifMTU = ifm->ifm_data.ifi_mtu;
break;
}
}
@ -635,14 +634,13 @@ nat_show_log(struct nat44_cfg_nat *n, void *arg)
static void
nat_show_cfg(struct nat44_cfg_nat *n, void *arg)
{
int i, cnt, flag, off;
int i, cnt, off;
struct nat44_cfg_redir *t;
struct nat44_cfg_spool *s;
caddr_t buf;
struct protoent *p;
buf = (caddr_t)n;
flag = 1;
off = sizeof(*n);
printf("ipfw nat %s config", n->name);
if (strlen(n->if_name) != 0)

View File

@ -387,11 +387,9 @@ table_create(ipfw_obj_header *oh, int ac, char *av[])
ipfw_xtable_info xi;
int error, tcmd, val;
uint32_t fset, fclear;
size_t sz;
char *e, *p;
char tbuf[128];
sz = sizeof(tbuf);
memset(&xi, 0, sizeof(xi));
while (ac > 0) {
@ -494,10 +492,7 @@ table_modify(ipfw_obj_header *oh, int ac, char *av[])
{
ipfw_xtable_info xi;
int tcmd;
size_t sz;
char tbuf[128];
sz = sizeof(tbuf);
memset(&xi, 0, sizeof(xi));
while (ac > 0) {
@ -1449,14 +1444,13 @@ tentry_fill_value(ipfw_obj_header *oh, ipfw_obj_tentry *tent, char *arg,
uint8_t type, uint32_t vmask)
{
struct addrinfo hints, *res;
uint32_t a4, flag, val, vm;
uint32_t a4, flag, val;
ipfw_table_value *v;
uint32_t i;
int dval;
char *comma, *e, *etype, *n, *p;
v = &tent->v.value;
vm = vmask;
/* Compat layer: keep old behavior for legacy value types */
if (vmask == IPFW_VTYPE_LEGACY) {