unused variables found via use-def analysis (plus an indentation micro-nit)

This commit is contained in:
Vern Paxson 2020-04-25 18:06:47 -07:00
parent 6e2cd3ae44
commit fe46ef06a0
5 changed files with 6 additions and 7 deletions

View file

@ -28,7 +28,6 @@ function connect_peer(node_type: NodeType, node_name: string)
function connect_peers_with_type(node_type: NodeType) function connect_peers_with_type(node_type: NodeType)
{ {
local rval: vector of NamedNode = vector();
local nn = nodes_with_type(node_type); local nn = nodes_with_type(node_type);
for ( i in nn ) for ( i in nn )

View file

@ -731,7 +731,7 @@ function find_rules_subnet(sn: subnet) : vector of Rule
{ {
local sn_entry = matches[m]; local sn_entry = matches[m];
local rule_ids = rules_by_subnets[sn_entry]; local rule_ids = rules_by_subnets[sn_entry];
for ( rule_id in rules_by_subnets[sn_entry] ) for ( rule_id in rule_ids )
{ {
if ( rule_id in rules ) if ( rule_id in rules )
ret += rules[rule_id]; ret += rules[rule_id];

View file

@ -195,7 +195,7 @@ function entity_to_match(p: PluginState, e: Entity): vector of OpenFlow::ofp_mat
return openflow_match_pred(p, e, v); return openflow_match_pred(p, e, v);
} }
local proto = OpenFlow::IP_TCP; # local proto = OpenFlow::IP_TCP;
if ( e$ty == FLOW ) if ( e$ty == FLOW )
{ {

View file

@ -336,5 +336,6 @@ function describe(rec: Info): string
(|rec$rcptto|>1 ? fmt(" (plus %d others)", |rec$rcptto|-1) : ""), (|rec$rcptto|>1 ? fmt(" (plus %d others)", |rec$rcptto|-1) : ""),
(abbrev_subject != "" ? fmt(": %s", abbrev_subject) : "")); (abbrev_subject != "" ? fmt(": %s", abbrev_subject) : ""));
} }
return "";
return "";
} }

View file

@ -70,11 +70,10 @@ const ip_addr_regex = ipv4_addr_regex | ipv6_addr_regex;
## Returns: T if every element is between 0 and 255, inclusive, else F. ## Returns: T if every element is between 0 and 255, inclusive, else F.
function has_valid_octets(octets: string_vec): bool function has_valid_octets(octets: string_vec): bool
{ {
local num = 0;
for ( i in octets ) for ( i in octets )
{ {
num = to_count(octets[i]); local num = to_count(octets[i]);
if ( num < 0 || 255 < num ) if ( 255 < num )
return F; return F;
} }
return T; return T;