pfctl: merge identifical if conditions and void functions discarding ret values
authorawolk <awolk@openbsd.org>
Fri, 16 Jun 2017 19:59:13 +0000 (19:59 +0000)
committerawolk <awolk@openbsd.org>
Fri, 16 Jun 2017 19:59:13 +0000 (19:59 +0000)
commit7363dae4f96fc51b67e37116157344c1739fe00d
tree7b5655d07385fdd7069d6b48e3d05117d43f3571
parent6e8d04c2b88fed4af2c5b0976ec2d74877adca2b
pfctl: merge identifical if conditions and void functions discarding ret values

Transform the following functions (which never return anything other than 0, and
whose return value is never used) to void:

* pfctl_clear_stats, pfctl_clear_interface_flags, pfctl_clear_rules,
  pfctl_clear_src_nodes, pfctl_clear_states
* pfctl_kill_src_nodes, pfctl_net_kill_states, pfctl_label_kill_states,
  pfctl_id_kill_states, pfctl_key_kill_states

inside main: merge two identical if conditions next to each other into one.

Submitted by rain1 (thanks!) with additional credit to:
 - mikeb@ for pointing out we can void all _clear_ functions
 - ghostyy for pointing out all _kill_ functions can be voided

OK tb@, mikeb@
sbin/pfctl/pfctl.c